UVA 11646 - Athletics Track(计算几何)
2015-03-05 16:40
330 查看
这是一题推推公式就可以的题目
假设L为X,然后就可以算出半径,然后根据余弦定理可以算出圆弧长度,然后就可以推出X,输出
代码:
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
double a, b;
int main() {
int cas = 0;
while (~scanf("%lf : %lf", &a, &b)) {
double tmp = b * b / a / a;
double x = acos((1 - tmp) / (1 + tmp)) / 2 * sqrt(1 + tmp) + 1;
x = 200.0 / x;
printf("Case %d: %.10f %.10f\n", ++cas, x, x / a * b);
}
return 0;
}
假设L为X,然后就可以算出半径,然后根据余弦定理可以算出圆弧长度,然后就可以推出X,输出
代码:
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
double a, b;
int main() {
int cas = 0;
while (~scanf("%lf : %lf", &a, &b)) {
double tmp = b * b / a / a;
double x = acos((1 - tmp) / (1 + tmp)) / 2 * sqrt(1 + tmp) + 1;
x = 200.0 / x;
printf("Case %d: %.10f %.10f\n", ++cas, x, x / a * b);
}
return 0;
}
相关文章推荐
- UVA - 11646 - Athletics Track (计算几何~)
- uva 11646 - Athletics Track(几何)
- UVA 11646 - Athletics Track || UVA 11817 - Tunnelling the Earth 几何
- UVA 11646 - Athletics Track || UVA 11817 - Tunnelling the Earth 几何
- 简单几何(推公式) UVA 11646 Athletics Track
- UVa 11646 - Athletics Track(几何)
- Athletics Track - UVa 11646 几何
- UVA 10652 Board Wrapping 计算几何
- uva579 计算几何入门
- UVALive 7461 Separating Pebbles (计算几何)
- UVA 11646 Athletics Track (简单数学题)
- UVa 754 Treasure Hunt <计算几何(相交判断)>
- uva 11880 Ball in a Rectangle(计算几何)
- UVALive 3263: That Nice Euler Circuit (计算几何)
- uva 10209 Is This Integration ? (计算几何)
- UVA 10256 (计算几何 凸包)
- 计算几何专项:UVa 754
- uva5984(简单计算几何)
- uva 12426 Counting Triangles 计算几何
- 计算几何专项:UVa 10674