加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

UVA 11646 - Athletics Track(计算几何)

发布时间:2020-12-13 20:15:26 所属栏目:PHP教程 来源:网络整理
导读:这是1题推推公式就能够的题目 假定L为X,然后就能够算出半径,然后根据余弦定理可以算出圆弧长度,然后就能够推出X,输出 代码: #include cstdio#include cstring#include algorithm#include cmathusing namespace std;double a,b;int main() { int cas = 0

这是1题推推公式就能够的题目

假定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 ",++cas,x,x / a * b); } return 0; }


(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读