Question: Write the program in Java. Exercise 1. (Great Circle Distance) Write a program GreatCircle.java that takes four doubles X1, yi, X2, and y2 representing the

 Write the program in Java. Exercise 1. (Great Circle Distance) Writea program GreatCircle.java that takes four doubles X1, yi, X2, and y2

Write the program in Java.

Exercise 1. (Great Circle Distance) Write a program GreatCircle.java that takes four doubles X1, yi, X2, and y2 representing the latitude and longitude in degrees of two points on earth as command-line arguments and writes the great-circle distance (in km) between them, given by the equation d= 111 arccos(sin(x1) sin(22) + cos(x1) cos(x2) cos(y1 - y2)). import stdlib.Stdout; public class Great Circle { // calculates the great circle distance given two sets of coordinates protected static double calculateGreat CircleDistance (String[] args) { // Get angles lati, loni, lat2, and lon2 from command line as // doubles. // Convert the angles to radians. // Calculate great-circle distance d. // Return d. // Entry point. [DO NOT EDIT] public static void main(String[] args) { Stdout.println (GreatCircle.calculateGreat CircleDistance (args))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!