#include <stdio.h> #include <math.h> #define PI 3.141592653589793 typedef struct{ double x,y; } Point; int main(char** argv, int argc){ Point ps[3]; double r = 0.0; while(scanf("%lf %lf %lf %lf %lf %lf", &ps[0].x, &ps[0].y, &ps[1].x, &ps[1].y, &ps[2].x, &ps[2].y)!=EOF){ double a2 = pow(ps[0].x-ps[1].x, 2) + pow(ps[0].y - ps[1].y, 2); double b2 = pow(ps[1].x-ps[2].x, 2) + pow(ps[1].y - ps[2].y, 2); double c2 = pow(ps[2].x-ps[0].x, 2) + pow(ps[2].y - ps[0].y, 2); double r2 = 4*a2*b2*c2/(pow(a2+b2+c2, 2)-2*(a2*a2+b2*b2+c2*c2)); printf("%.2lf\n", PI * sqrt(r2)); } return 0; }
UVA 438 求三角形外接圆的周长
最新推荐文章于 2022-02-23 15:02:25 发布