uva 11817 - Tunnelling the Earth(几何)
来源:互联网 发布:linux vi 滚动几行 编辑:程序博客网 时间:2024/06/06 02:11
题目链接:uva 11817 - Tunnelling the Earth
#include <cstdio>#include <cstring>#include <cmath>#include <algorithm>using namespace std;const double R = 6371009;const double pi = 4 * atan(1.0);struct Point {double x, y, z;}p[2];Point getPoint(double a, double b) {double z = R * sin(a);double t = R * cos(a);double x = t * cos(b);double y = t * sin(b);return (Point){x, y, z};}double distant(Point a, Point b) {double x = a.x - b.x;double y = a.y - b.y;double z = a.z - b.z;return sqrt(x * x + y * y + z * z);}int main () {int cas;scanf("%d", &cas);while (cas--) {double a, b;for (int i = 0; i < 2; i++) {scanf("%lf%lf", &a, &b);p[i] = getPoint(a / 180 * pi, b / 180 * pi);}double D = distant(p[0], p[1]);double tha = 2 * asin(D / (2 * R));double L = R * tha;printf("%.0lf\n", L - D);}return 0;}
0 0
- uva 11817 - Tunnelling the Earth(几何)
- UVA 11646 - Athletics Track || UVA 11817 - Tunnelling the Earth 几何
- Tunnelling the Earth - UVa 11817 几何球上的距离
- UVA 11817 Tunnelling the Earth
- UVA 11817 Tunnelling the Earth
- UVa 11817 - Tunnelling the Earth
- UVA 11817 Tunnelling the Earth
- uva 11817 - Tunnelling the Earth
- UVa 11817 - Tunnelling the Earth
- UVA 11817 - Tunnelling the Earth
- UVA 11817 Tunnelling the Earth
- 球面距离 UVA 11817 Tunnelling the Earth
- UVa 11817 Tunnelling the Earth(球面距离)
- uva 11817 Tunnelling the Earth 球
- UVA 11817 - Tunnelling the Earth(球面)
- UVa 11817 Tunnelling the Earth 计算球面距离
- UVA11817 - Tunnelling the Earth
- UVA 11800 - Determine the Shape 几何
- ORACLE的Copy命令和create table,insert into的比较
- Net常见面试题整理(2)——装箱和拆箱
- 去掉UItableview header(footer)view黏性(sticky)
- CentOS 下用的是lnmp 的包配置Nginx 下的CI伪静态(搞爽了)
- ubuntu设置时区,网上同步时间
- uva 11817 - Tunnelling the Earth(几何)
- HR喜欢这样的简历(转自豆瓣)
- hdoj1014
- 【学习ios之路:Objective-C】OC中常用的系统排序方法
- 友盟全线 SDK 兼容 iOS 8!
- mysql查询表和字段的注释
- 回首2014,展望2015
- C#基础知识系列一(goto、i++、三元运算符、ref和out、String和string、重载运算符)
- 友盟消息推送新版 SDK 为什么要支持多包名推送?