三角形外心的模板
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
double length(double a, double b, double c, double d)
{
double side_length;
side_length=sqrt((a-c)*(a-c)+(b-d)*(b-d));
return side_length;
}
int main()
{
double x1, x2, x3, y1, y2, y3;
double a, b, c;
double pas,area_triangle, radius, diameter;
while(scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3)!=EOF)
{
a=length(x1,y1,x2,y2);
b=length(x2,y2,x3,y3);
c=length(x1,y1,x3,y3);
pas=(a+b+c)/2;
area_triangle=sqrt(pas*(pas-a)*(pas-b)*(pas-c));
radius=a*b*c/(4*area_triangle);
diameter=2*radius;
printf("%.2f\n",3.141592653589793*diameter);
}
return 0;
}