Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that computes the spherical distance between two points on the surface of the Earth, given their latitudes and longitudes. This is a
Write a program that computes the spherical distance between two points on the surface of the Earth, given their latitudes and longitudes. This is a useful operation because it tells you how far apart two cities are if you multiply the distance by the radius of the Earth, which is roughly kmLet and P be the latitude and longitude of two points, respectively. the longitudinal difference, and Ao the angular differencedistance in radians, can be determined as follows from the spherical law of cosines:Ao arccossin P sin cos cos cos ANFor example, consider the latitude and longitude of two major cities:
Nashville TN: N deg W deg
Los Angeles, CA: N deg W deg
You must convert these coordinates to radians before you can use them effectively in the formula. After conversion, the coordinates become
Nashville: deg rad, Adeg rad
Los Angeles: deg rad, deg rad
Using these values in the angular distance equation, you get
rAo X km
Thus, the distance between these cities is about km or miles. Note: To solve this problem, you will nec to use the Math. acos method, which returns an arccosine angle in radians.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started