Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1 Python : In this project, you will work with the data file cities.txt. The file is available in the files section of this

Part 1 Python : In this project, you will work with the data file cities.txt. The file is available in the files section of this course. For this project, you will have to calculate the distance between two points on the planet by assuming Earth is a perfect sphere or radius R = 6360 km. You can use the Haversine formula to calculate this distance: LaTeX: d\:=\:2\:R\:\arcsin\left(\sqrt{\sin^2\left(\frac{\varphi_2-\varphi_1}{2} ight)+\cos\left(\varphi_1 ight)\cos\left(\varphi_2 ight)\sin^2\left(\frac{\lambda_2-\lambda_1}{2} ight)} ight) d = 2 R arcsin ( sin 2 ( 2 1 2 ) + cos ( 1 ) cos ( 2 ) sin 2 ( 2 1 2 ) ) where LaTeX: \varphi_1,\varphi_2 1 , 2 are the latitude (north-south position) of point 1 and latitude of point 2, and LaTeX: \lambda_1,\lambda_2 1 , 2 are the longitude (east-west position) of point 1 and longitude of point 2. All of these magnitudes are in radians. Please remember latitudes and longitudes in the data file are based on geographical degrees, not decimal degrees. This means you will have to convert the data from its current DMS (degree-minute-second) format. This can be easily achieved by considering a degree is divided into sixty minutes. That means we can convert from a DMS coordinate to a decimal degree coordinate Cdec by using the following formula: LaTeX: C_{dec}=D+\frac{M}{60}+\frac{S}{3600} C d e c = D + M 60 + S 3600 For example, the DMS coordinate 2326' N converts to 23.43 N using this system. Finally, notice this approach gives you degrees, not radians. Part 2: MATLAB In this case, you will write a program that suggests a road trip itinerary. You will use the same data file as before. Your program should read the data file and output the suggested road trip itinerary (list of cities) organized by latitude or longitude as required by the list of features below. As before, you can assume all travel happens in straight lines. Your program should do the following: Read the data in cities.txt Ask the user for a specific state in the US they want to visit Sort the cities in that state north-south or east-west depending on which direction the state is longer. For example, California cities would be north-south while Tennessee cities would be east-west Output a road trip itinerary with all the cities in order. Add a rest stop whenever the distance between the cities is greater or equal to 100 miles Cities text file : https://www.dropbox.com/s/rqh6dtw5399fcek/cities.txt?dl=0

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

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions

Question

Has the priority order been provided by someone else?

Answered: 1 week ago

Question

Compare the current team to the ideal team.

Answered: 1 week ago

Question

Are the rules readily available?

Answered: 1 week ago