Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercator map projection logic conflict

I'm looking for an explanation on why there are 2 different mercator formulas discussed on these sites.

I understand this to be the correct mercator projection algorithm:

http://en.wikipedia.org/wiki/Mercator_projection

y = ln|sec(lat) + tan(lat)| 

However, this site refers to something completely different: http://wiki.openstreetmap.org/wiki/Mercator

#include <math.h>
double lat2y(double a) { return 180/M_PI * log(tan(M_PI/4+a*(M_PI/180)/2)); }

Any ideas?

like image 927
glutz Avatar asked Feb 04 '12 19:02

glutz


People also ask

What is the problem with Mercator map projections?

Mercator maps distort the shape and relative size of continents, particularly near the poles. This is why Greenland appears to be similar in size to all of South America on Mercator maps, when in fact South America is more than eight times larger than Greenland.

Why are Mercator projection maps not accurate?

Mercator is NOT well suited for navigation It's true that lines of constant compass bearing appear straight on the map. But lines of constant compass bearing are in fact curved. To illustrate, imagine you wanted to fly from New York to London.

What are map projections weaknesses?

Disadvantages: Mercator projection distorts the size of objects as the latitude increases from the Equator to the poles, where the scale becomes infinite. So, for example, Greenland and Antarctica appear much larger relative to land masses near the equator than they actually are.

Does the Mercator projection distort direction?

Because the linear scale of a Mercator map increases with latitude, it distorts the size of geographical objects far from the equator and conveys a distorted perception of the overall geometry of the planet.


1 Answers

Both formulas are equal.

  • sec(x) + tan(x) = [ 1 + sin(x) ] / cos(x)

    sec(x) + tan(x) = [ 1 + sin(x) ] / cos(x)

  • tan(pi/4 + x/2) = sin(pi/4 + x/2) / cos(pi/4 + x/2) =

    = [cos(x/2) + sin(x/2)] / [cos(x/2) - sin(x/2)] =

    = [cos(x/2) + sin(x/2)]^2 / [cos(x/2) - sin(x/2)] / [cos(x/2) + sin(x/2)] =

    = [1 + 2*cos(x/2)*sin(x/2)] / [cos^2(x/2) - sin^2(x/2)] =

    = [1 + sin(x)] / cos(x)

    enter image description here

The latter formula is more convenient for numerical calculations, because it involves the computation of the trigonometric function only once.

like image 97
valdo Avatar answered Oct 03 '22 15:10

valdo