PersonalCorpus 版 (精华区)

Your C++ program has solved Ok the problem 438 (The Circumference of the
 Circle)
in 0.000 seconds with low memory spent.


double circumscribed_circle(double a, double b, double c, double d, 
double e, double f)
{
    double T=((a-c)*(a-c)+(b-d)*(b-d)+(a-e)*(a-e)+(b-f)*(b-f)\
            -(c-e)*(c-e)-(d-f)*(d-f))/2/sqrt((a-c)*(a-c)+(b-d)*(b-d))\
            /sqrt((a-e)*(a-e)+(b-f)*(b-f));
    return sqrt((c-e)*(c-e)+(d-f)*(d-f))/sqrt(1-T*T);
}

void main()
{
    double a,b,c,d,e,f;
    while (scanf("%lf%lf%lf%lf%lf%lf\n",&a,&b,&c,&d,&e,&f)==6) {
        printf("%.2lf\n",circumscribed_circle(a,b,c,d,e,f)*3.
141592653589793);
    }
}
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:1.936毫秒