这也算计算几何???><。。。我一直把这类题归类于关于数的处理。。。
给你三个点,求这三个点的外接圆的周长。
套公式即可。
看来需要把遇到的数学公式总结下了。
#include <queue>
#include <stack>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <limits.h>
#include <string.h>
#include <algorithm>
using namespace std;
const double pi = 3.141592653589793;
struct point{
double x,y;
};
double dis( point a,point b)
{
return sqrt( (a.x - b.x)*(a.x - b.x) + (a.y - b.y)*(a.y - b.y) );
}
int main()
{
point ap,bp,cp;
while( ~scanf("%lf %lf %lf %lf %lf %lf",&ap.x,&ap.y,&bp.x,&bp.y,&cp.x,&cp.y) )
{
double a,b,c;
a = dis(ap,bp); b = dis(bp,cp); c = dis(cp,ap);
double r = a*b*c/sqrt((a+b+c)*(a+b-c)*(a+c-b)*(b+c-a));
printf("%.2lf/n",r*2*pi);
}
return 0;
}