# Howto calculate the latitude of a given y coordinate from a mercator projected map

Say I have a mercator projection map:

I would like to calculation the latitude for different points with one formula. I have already resaerched several sites and wikipedia, where the hole math is explained and predefined formulas exists, but they all do not work for me. For the extremes like north pole, south pole and Equator they work. But for places in between them, I do not get the correct results.

Can someone help me, just writing down the correct formula to calculate the latitude from a y point.

latitude(y) = ?

A : y=-1 -> latitude = 90

B: y=0 -> latitude = 0

C: y= 1 -> latitude = -90

D: y= 0.2 (around) -> latitude = -34 (around) This is cape town.

I tried the following formulas, which did not work for me:

• The North and South Poles would have $y=\pm\infty$ on a Mercator projection – Henry Apr 29 '18 at 12:55
• Means, there is no formula for calculating the latitude from a given Mercator projection ? – mcfly soft Apr 29 '18 at 13:23
• This simply means that the poles cannot be represented on a Mercator projection. This projection is generally used between latitudes -85° and +85° (resulting in a square-shaped projection), as anything closer to the poles would become unreasonably stretched. – FSimardGIS Apr 30 '18 at 3:48
• @FSimardGIS - any thoughts on my question - math.stackexchange.com/questions/2745642/… ? – gansub Apr 30 '18 at 6:17
• I'll take a closer look tonight. The Earth's surface in not a plane, so the formulas will be significantly more complex. – FSimardGIS Apr 30 '18 at 16:17

The inverses of your functions are $$x = R( \lambda - \lambda_0)$$ $$y = R\ln \left[\tan \left(\frac{\pi}{4} + \frac{\varphi}{2} \right) \right]$$

where $R$ is a scaling factor and angles are measured in radians, so multiply degrees by $\frac{\pi}{180}$

So for example (taking $R=1$ and $\lambda_0=0$ for the Greenwich Meridian)

• Cape Town at around $34^\circ S, 18.5^\circ E$ would have $\varphi \approx -0.59341$ and $\lambda \approx 0.32289$ so $x \approx 0.32289$ and $y \approx -0.63166$

• Kaffeklubben Island (north of Greenland) at around $83.6625^\circ N, 30.6139^\circ W$ would have $\varphi \approx 1.46019$ and $\lambda \approx -0.53431$ so $x \approx -0.53431$ and $y \approx 2.89387$

• Fiji at around $18^\circ S, 179^\circ E$ would have $\varphi \approx -0.31416$ and $\lambda \approx 3.12414$ so $x \approx 3.12414$ and $y \approx -0.31946$

If you would prefer to have $-1 \le x \le 1$ then you could take take $R=\frac1{\pi}$, and that would also have the effect of making the $y$ values of interesting places apart from the North and South Poles be in the range $[-1,1]$

If on the other hand, you have measured that Cape Town is $0.2$ (metres?) south of the equator on your Mercator projection (and just over $0.1$ east of the prime median, noting point B on your diagram is too far west), this suggests that $R \approx \frac{0.2}{0.63166}$ and you can apply your original formulae - not forgetting a radian/degree change at the end

• Thanks Henry. But either I do not understand or you did not understand me . 0.2 is the position in the Map (not meters !). The Map is(y=-1..1, x=-1..1) See my Screenshot and you will understand what I mean with 0.2. From your answer I am not able to figure out how I can calculate the latitude (Phi). Can you simply show me how I get to 34 S from 0.2 on the map ? I do not need x,y. I already have them on the map. What I need is to get to the latitude from a position on the Map. The Map has a size of say 2,2 (-1..1, -1..1) and Capetown is at around y = +0.2. – mcfly soft Apr 30 '18 at 4:31
• If you take my final suggestion for $R \approx 0.316627$ then $2\tan^{-1}\left[\exp\left(\frac{-0.2}{0.316627}\right)\right]-\frac{\pi}{2} \approx -0.59341$ in radians and so $-0.59341\times \frac{180^\circ}{\pi} \approx -34^\circ$ – Henry Apr 30 '18 at 7:49
• Perfect, Now I get it. – mcfly soft May 6 '18 at 5:45