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

177 Views Asked by At

Say I have a mercator projection map:

enter image description here

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:

enter image description here

enter image description here

1

There are 1 best solutions below

3
On BEST ANSWER

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