您的位置:首页 > 其它

HDU 5476 Explore Track of Point

2015-10-09 11:31 375 查看
2015 ACM/ICPC Asia Regional Shanghai Online 

老师推出的公式,现在还没看懂

#include <stdio.h>
#include <string.h>
#include <math.h>
const double pi = acos(-1.0);
double a, b, h, A, res;
double x1, x2, x3, y, y2, y3;
int main()
{
int t, k;
scanf("%d", &t);
k = 1;
while(t--)
{
scanf("%lf %lf %lf %lf %lf %lf", &x1, &y, &x2, &y2, &x3, &y3);
a = sqrt((x2-x3)*(x2-x3) + (y2-y3)*(y2-y3));
b = sqrt((x1-x2)*(x1-x2) + (y-y2)*(y-y2));
h = sqrt(b*b-(a/2)*(a/2));
A = asin(a/(2*b));
res = h + b * a / (2 * h) * (pi - 2 * A);
printf("Case #%d: %.4lf\n",k++, res);
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  2015Online HDU