Uva 10221

From Algorithmist
Jump to navigation Jump to search

10221 - Satellites[edit]

Summary[edit]

Basic geometry problem.

Explanation[edit]

To calculate the arc distance use

angle = arc/redius

. To calculate chord distance use

angle = arccos ((x^2 + y^2 - z^2) / 2xy)

.

Gotcha's[edit]

  • Don't forget to convert degrees and minutes to radian.
  • Careful when angle is greater than 180 degree.

Input[edit]

500 30 deg
700 60 min
200 45 deg
500 200 deg

Output[edit]

3633.775503 3592.408346
124.616509 124.614927
5215.043805 5082.035982
19380.136014 13669.131612