簡單 時間限制:3 s記憶體限制:256 MB

Online Judge - 10221 - Satellites

來源代碼:UVa
數學CPE歷屆試題CPE一星
前往提交 ↓

The radius of earth is 6440 Kilometer. There are many Satellites and Asteroids moving around the earth. If two Satellites create an angle with the center of earth, can you find out the distance between them? By distance we mean both the arc and chord distances. Both satellites are on the same orbit (However, please consider that they are revolving on a circular path rather than an elliptical path).

image.png

輸入說明

The input file will contain one or more test cases.

Each test case consists of one line containing two-integer s and a, and a string ‘min’ or ‘deg’. Here s is the distance of the satellite from the surface of the earth and a is the angle that the satellites make with the center of earth. It may be in minutes (′ ) or in degrees (◦ ). Remember that the same line will never contain minute and degree at a time.

輸出說明

資料格式說明

For each test case, print one line containing the required distances i.e. both arc distance and chord distance respectively between two satellites in Kilometer. The distance will be a floating-point value with six digits after decimal point.

輸入輸出範例

範例 1

範例輸入
500 30 deg
700 60 min
200 45 deg
範例輸出
3633.775503 3592.408346
124.616509 124.614927
5215.043805 5082.035982

範例 2

範例輸入
100 0 deg
100 180 deg
範例輸出
0.000000 0.000000
20546.015954 13080.000000

範例 3

範例輸入
100 270 deg
100 16200 min
100 21600 min
範例輸出
10273.007977 9248.956698
10273.007977 9248.956698
0.000000 0.000000
開啟討論
開啟紀錄

登入後即可撰寫程式、測試範例及提交解答。

登入