Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in python please GPS Unit for Hikers GPS has been built into a wide variety of consumer devices. They share many features, but differ in

in python please

image text in transcribedimage text in transcribed

GPS Unit for Hikers GPS has been built into a wide variety of consumer devices. They share many features, but differ in details. Here we consider the GPS unit used by hikers and back-country explorers. An important fearure of such units is the ability to mark wapoints, including the ability to collect them into a path that can be retrieved later. Another important feature is distance and bearing to a waypoint: you have a target waypoint, and you want to know what direction it is in and the distance to that target. This last feature is particularly useful in geocaching or locating your starting point, if you are lost. When queried the GPS hardware generates the current longitude and latitude: a pair of floating-point values. The range of longitude is 180 degrees to +180 degrees (the reference point (0) is the meridian through Greenwich, England). The range of latitude is 90 degrees to +90 degrees (the reference point (0) is the equator with positive values in the northern hemisphere). For example, according to the "Farmer's Almanac" the "middle" of the United States is at latitude 39.83333 degrees, longitude 98.5833 degrees. That is near the town of Lebanon, in Smith County, Kansas. We need to simulate that capability in this exercise. Write a method named gps_get_1ong_1 at that returns a longitude and latitude pair. The method uses the Python random module to generate the pair. A waypoint will be a position, a longitude-latitude pair, with a name. Implement the following capabilities: - Your GPS unit should be able to save the current waypoint, that is, save the current position as a waypoint, and associate a name with the position. - Your GPS unit should be able to save and retrieve named paths consisting of a sequence of waypoints. - It should also be able to find the length of a given path-assuming a straight line between each waypoint. - Your GPS unit should be able to calculate the distance to a waypoint (from the current location). Write a main program that loops and prompts the user for functionality provided by the GPS unit. Create a session that tests all methods. Optional: add a method to calculate a bearing between the current position and a waypoint. Hint use the math inverse tangent (atan) function, but the atan 2 function may be slightly easier to work with

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

Students also viewed these Databases questions

Question

Explain methods of metal extraction with examples.

Answered: 1 week ago