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?
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.
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.
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.
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.
Both formulas are equal.
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)
The latter formula is more convenient for numerical calculations, because it involves the computation of the trigonometric function only once.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With