编程介的小学生 2017-04-19 08:18 采纳率: 20.5%
浏览 859
已采纳

Polaris of Pandora

Polaris is a star, it is the most magnificent scene in the sky, and the most important navigation star of planet Pandora[1]. People live in Pandora call themselves as "Na'vi"[2], and they all love to fly in the sky with their ikran[3]. When they are flying in the sky, they use Polaris to navigate. Polaris could be used to navigate because that it is always staying in the straight line linking the North pole and the South pole of Pandora. That straight line could also be called as "axis of Pandora", and Polaris stays on the North pole side.

Polaris is too far away from Pandora, so in every place near Pandora, light from Polaris could be regarded as parallel to axis of Pandora. Now several Na'vi ikran riders are flying in the sky of Pandora, they want to know the percentage of their whole flying distance that Polaris is visible. Polaris's light is quite bright, so Polaris is visible even when it is just on the skyline.

To simplify the problem, Na'vi riders assume that Pandora is a perfect sphere, which have a R radius. A rider starts flying from a point on the Pandora's surface and lands at another point, the flying height is given as H. Ikran is so powerful that flying time between the surface of Pandora and the flying height could be ignored, and ikran will always fly straight up and down between surface and flying height. Both the starting point and the landing point could be described using latitude and longitude[4] of Pandora. And riders will always choose the shortest path to fly.

Input

There are several test cases. Process to the end of file.

The only line of each test case contains 6 real numbers R (1000 ≤ R ≤ 10000), H (1 ≤ H ≤ R), lat0 (-π/2 < lat0 < π/2), lng0 (-π < lng0 < π), lat1 (-π/2 < lat1 < π/2), lng1 (-π < lng1 < π). R is radius of planet Pandora, H is Na'vi ikran rider's flying height, lat0 and lng0 are latitude and longitude of starting point, lat1 and lng1 are latitude and longitude of landing point.

We guarantee that starting point and landing point will not be the same, and they also will not be "opposite" (Starting point, landing point and Pandora's center will not be in the same line.)

Output

For each test case, output one line with the percentage of the flying distance that Polaris is visible. Round to 3 decimal places.

Sample Input

1000 10 0 0 0 0.5
4000 1000 0 0.618 1.0 0.618
Sample Output

100.000
64.350

  • 写回答

3条回答 默认 最新

  • threenewbee 2017-05-05 03:35
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)
  • ¥20 matlab yalmip kkt 双层优化问题