Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLE HELP ME BY PYTHON PLE HELP ME BY PYTHON Part 3: Spherical Distance The earth is not flat (sorry to disappoint you), so the
PLE HELP ME BY PYTHON
PLE HELP ME BY PYTHON
Part 3: Spherical Distance The earth is not flat (sorry to disappoint you), so the shortest distance between two points is not a straight line but the great circle. Write a function called great_circle_distance that has four parameters: the latitude and longitude (in degrees) of one city and the latitude and longitude (in degrees) of another city. The function returns the distance between the cities in kilometers, using this formula, which is accurate for large distances: Let 1, 3 be the latitude and longitude of the first city (in radians). Let 02, A2 be the latitude and longitude of the second city (in radians) Let R be 6371, the radius of the earth in kilometers. Calculate the central angle with this formula: 0 = arccos sin 02 - sin 02 +COS 04.CoS 02.cos(N4 - A211) The great circle distance d =R-6 Write another function named ku_to_miles() which has one parameter-the distance in kilometers-and returns the distance in miles. One kilometer is 0.621371 miles. Given these latitudes and longitudes: City Latitude Longitude San Jose 37.33 -121.9 Chicago 41.83 -87.68 Washington, D.C. 38.90 -77.02 Write a program that calculates the distance from San Jose to Chicago, and the distance from Chicago to Washington D.C. and prints the distances in both miles and kilometers, properly labeled, as integers. You may use this site e to check your answers. Name the program Lastnome firstrume_great_circle.py
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