The great circle distance is the distance between two points on the surface of a sphere. Let (x_{1}, y_{1}) and (x_{2}, y_{2}) be the geographical latitude and longitude of two points. The great circle distance between the two points can be computed using the following formula:

?d = radius * arccos(sin(x_{1}) * sin(x_{2}) + cos(x_{1}) * cos(x_{2}) * cos(y_{1} - y_{2}))

Write a program that prompts the user to enter the latitude and longitude of two points on the earth in degrees and displays its great circle distance. The average earth radius is 6,371.01 km. Note that you need to convert the degrees into radians using the Math.toRadians method since the Java trigonometric methods use radians. The latitude and longitude degrees in the formula are for north and west.

?Use negative to indicate south and east degrees. Here is a sample run:

**Transcribed Image Text:**

## Enter point 1 (latitude and longitude) in degrees: 39.55, -116.25 Enter point 2 (latitude and longitude) in degrees: 41.5, 87.37 -Enter The distance between the two points is 10691.79183231593 km JEnter