Q9 Write a program to receive values of latitude and longitude, in degrees, of two places on the earth and outputs the distance between then in nautical miles. The formula for distance in nautical miles is here

Program: 67

Write a program to receive values of latitude and longitude, in degrees, of two places on the earth and outputs the distance between then in nautical miles. The formula for distance in nautical miles is:

D = 3963 \ast \cos^{-1}\left ( \cos {\left ( L2-L1 \right )} \ast \cos {\left ( G2-G1 \right )} \right )

Output:

Enter the co-ordinate of first place: 29.3787077 78.1042091
Enter the co-ordinate of second place: 29.6070158 78.3266826
The distance between two place in kilometer: 31.88
The distance between two place in nautical miles: 17.21

Lokesh Kumar

Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.