Question: Great circle. Write a program GreatCircle that takes four double command-line argumentsx1, y1, x2, and y2(the latitude and longitude, in degrees, of two points on
Great circle. Write a program GreatCircle that takes four double command-line arguments—x1, y1, x2, and y2—(the latitude and longitude, in degrees, of two points on the earth) and prints the great-circle distance between them.
The great-circle distance (in nautical miles) is given by the following equation:![]()
Note that this equation uses degrees, whereas Java’s trigonometric functions use radians.
Use Math.toRadians() and Math.toDegrees() to convert between the two.
Use your program to compute the great-circle distance between Paris (48.87° N and 2.33° W) and San Francisco (37.8° N and 122.4° W).
d = 60 arccos (sin(x) sin(x)+ cos(x) cos(x) cos(y- y))
Step by Step Solution
3.34 Rating (148 Votes )
There are 3 Steps involved in it
Certainly Lets use Java to write a program to calculate the greatcircle distance between two points ... View full answer
Get step-by-step solutions from verified subject matter experts
