ACM (TJU) : 1131


#include <iostream>
#include <cmath>
using namespace std;
#define PI 3.141592653589793

int main ()
{
    double x1, x2, x3;
    double y1, y2, y3;

    while ( cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 ) {

        double a = sqrt (pow (x1 - x2, 2) + pow (y1 - y2, 2));
        double b = sqrt (pow (x2 - x3, 2) + pow (y2 - y3, 2));
        double c = sqrt (pow (x1 - x3, 2) + pow (y1 - y3, 2));

        double s = (a + b + c ) / 2;

        double l = sqrt( s*(s-a)*(s-b)*(s-c));
        double r = (a*b*c)/(4*l);

        printf ("%.2lf\n", (2*PI*r));

    }

    return 0;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s