Answered step by step
Verified Expert Solution
Link Copied!

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 6372.795 km.Let 41,1, and P2,1, be the latitude and longitude of two points, respectively. 1, the longitudinal difference, and Ao, the angular difference/distance in radians, can be determined as follows from the spherical law of cosines:Ao = arccos(sin P, sin 42+ cos 4, cos 4, cos ANFor example, consider the latitude and longitude of two major cities:
Nashville, TN: N 36\deg 7.2', W 86\deg 40.2'
Los Angeles, CA: N 33\deg 56.4', W 118\deg 24.0'
You must convert these coordinates to radians before you can use them effectively in the formula. After conversion, the coordinates become
Nashville: 41=36.12\deg =0.6304 rad, A,=-86.67\deg =-1.5127 rad
Los Angeles: 92=33.94\deg =0.5924 rad, 42=-118.40\deg =-2.0665 rad
Using these values in the angular distance equation, you get
rAo =6372.795 X 0.45306=2887.259 km
Thus, the distance between these cities is about 2887 km, or 1794 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

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

Compute the value of D in the diagram. 300 200 100 -6 -7 i- 10% 0-

Answered: 1 week ago