#define
PAI 3.1415926
#include < stdio.h >
#include < math.h >
// 求三角形外接圆周长
// 三角形三边a,b,c,半周长p(p=(a+b+c)/2)
// 面积:S= √[p(p - a)(p - b)(p - c)]
// 外接圆半径 R=abc/4S
// 外接圆半径 R=abc/4√[p(p - a)(p - b)(p - c)]
// 外接圆周长C=2*PAI*R
float S( float x1, float y1, float x2, float y2, float x3, float y3){
return ((x1 - x3) * (y2 - y3) - (y1 - y3) * (x2 - x3) );
}
float cal_center_x( float x1, float y1, float x2, float y2, float x3, float y3){
return (S(x1 * x1 + y1 * y1,y1, x2 * x2 + y2 * y2, y2,x3 * x3 + y3 * y3,y3) / ( 2 * S(x1,y1,x2,y2,x3,y3)) );
}
float cal_center_y( float x1, float y1, float x2, float y2, float x3, float y3){
return (S(x1, x1 * x1 + y1 * y1, x2, x2 * x2 + y2 * y2, x3, x3 * x3 + y3 * y3) / ( 2 * S(x1,y1,x2,y2,x3,y3)));
}
int main()
{
float x1, y1, x2, y2, x3, y3, x, y;
while (scanf( " %f %f %f %f %f %f " , & x1, & y1, & x2, & y2, & x3, & y3) != EOF)
{
x = cal_center_x(x1, y1, x2, y2, x3, y3);
y = cal_center_y(x1, y1, x2, y2, x3, y3);
float C = 2 * PAI * sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));
printf( " %.2f\n " , C);
}
return 0 ;
}
#include < stdio.h >
#include < math.h >
// 求三角形外接圆周长
// 三角形三边a,b,c,半周长p(p=(a+b+c)/2)
// 面积:S= √[p(p - a)(p - b)(p - c)]
// 外接圆半径 R=abc/4S
// 外接圆半径 R=abc/4√[p(p - a)(p - b)(p - c)]
// 外接圆周长C=2*PAI*R
float S( float x1, float y1, float x2, float y2, float x3, float y3){
return ((x1 - x3) * (y2 - y3) - (y1 - y3) * (x2 - x3) );
}
float cal_center_x( float x1, float y1, float x2, float y2, float x3, float y3){
return (S(x1 * x1 + y1 * y1,y1, x2 * x2 + y2 * y2, y2,x3 * x3 + y3 * y3,y3) / ( 2 * S(x1,y1,x2,y2,x3,y3)) );
}
float cal_center_y( float x1, float y1, float x2, float y2, float x3, float y3){
return (S(x1, x1 * x1 + y1 * y1, x2, x2 * x2 + y2 * y2, x3, x3 * x3 + y3 * y3) / ( 2 * S(x1,y1,x2,y2,x3,y3)));
}
int main()
{
float x1, y1, x2, y2, x3, y3, x, y;
while (scanf( " %f %f %f %f %f %f " , & x1, & y1, & x2, & y2, & x3, & y3) != EOF)
{
x = cal_center_x(x1, y1, x2, y2, x3, y3);
y = cal_center_y(x1, y1, x2, y2, x3, y3);
float C = 2 * PAI * sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));
printf( " %.2f\n " , C);
}
return 0 ;
}