Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 6. (Mercator Projection) The Mercator projection is a conformal (angle preserving) projection that maps latitude and longitude to rectangular coordinates (x, y). It is

Problem 6. (Mercator Projection) The Mercator projection is a conformal (angle preserving) projection that maps latitude and longitude to rectangular coordinates (x, y). It is widely used for example, in nautical charts and in the maps that you print from the web. The projection is defined by the equations x = 0 and y = ln((1 + sin )/(1 sin ))/2, where 0 is the longitude of the point in the center of the map. Write a program mercator.py that takes three floats 0, , and as command-line arguments and writes its projection, ie, the x and y values, separated by a space. Note that the equations use degrees, whereas Pythons trigonometric functions use radians. Use math.radians() to convert degrees to radians. Use your program to compute the Mercator projection of Boston (42.36 N and 71.06 W) with the center of the map being the prime meridian (0).

$ python mercator.py 0 42.36 -71.06

-71.06 0.817646151942

mercator.py =

# mercator.py: Takes three floats l0, phi, and l as command-line arguments and # prints its projection, i.e., the x and y values separated by a space, # calculated using x=l-l0 and y=ln(1+sin(phi)/(1-sin(phi)))/2.

import math import stdio import sys

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 Systems For Advanced Applications 15th International Conference Dasfaa 2010 Tsukuba Japan April 2010 Proceedings Part 1 Lncs 5981

Authors: Hiroyuki Kitagawa ,Yoshiharu Ishikawa ,Wenjie Li ,Chiemi Watanabe

2010th Edition

3642120253, 978-3642120251

More Books

Students also viewed these Databases questions

Question

Semantics is to syntax as _ _ _ _ _ is to _ _ _ _ _ .

Answered: 1 week ago