Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need a proper code to execute and run the programs issignment Portion - hand in your wo nce completed 4.2 (Geometry: gneat circle distance)

image text in transcribed
i need a proper code to execute and run the programs
issignment Portion - hand in your wo nce completed "4.2 (Geometry: gneat circle distance) The great circle distance is the distance between two points on the surface of a sphere. Let (x1,y1) and (x2,y2) 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=radiusarccos(sin(x1)sin(x2)+cos(x1)cos(x2)cos(y1y2)) Write a program that prompts the user to enter the latitude and longitode of two points on the earth in degrees and displays its great circle distance. The average radius of the earth is 6,371.01km. Note you need to convert the degrees into radians using the Math, toRadi ans 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: Enter point 1 (1atitude and longitude) in degrees: 39.55116.25 Enter point 2 (1atitude and longitude) in degrees: 41.587.37 The distance between the two points is 10691.79183231593km

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions