Calculate Latitude from a Mercato Projection Map

133 Views Asked by At

I have an Mercator Projection Map: enter image description here

And I try to calculate the Latitude from a specific Y-Point on the map. According to this article : http://paulbourke.net/geometry/transformationprojection/ the formula is as follow:

latitude = atan(exp(-2 * pi * y))

y = -1..1

I tried this using java code, but I do not succeed to get the expected result:

double southpoleLocation = 1;
double latSouthPole = Math.toDegrees(Math.atan(Math.exp(-2 * Math.PI * southpoleLocation )));
System.out.println(latSouthPole);

For the red circle (picture) I expected to get -90 as the latitude (degrees), but I get something near 0.

Can someone help me to get the correct latitude from a y coordination ?

2

There are 2 best solutions below

1
On

A likely source of confusion is that cartographers and mathematicians use different coordinate systems. Cartographers measure latitude so that the latitude of the equator is zero degrees, whereas mathematicians measure latitude (sometimes called co-latitude) so that the latitude of the north pole is zero.

0
On

The formula in the link you provided is incorrect. It should be $\text{latitude} = 2\arctan\left(\exp\left(\pi y\right)\right)-\pi/2$. Using this I arrive at 33.8° for y=0.2

Note that since the direction of the y axis is reversed from the traditional direction, you have to multiply the result by -1, which translates to this: $\text{latitude} = \pi/2 - 2\arctan\left(\exp\left(\pi y\right)\right)$.

Also, note that the latitude of a point located at y=1 will not be -90°, but -85.05° in a Mercator projection. The poles are not represented on that projection.