Mercator Projection distortion problem

Hey there,

I’m currently working on a system where I need to calculate latitude and longitude based on the mouse’s relative position to an image. The code itself is quite straightforward and functional.

However, there’s a slight issue I’ve encountered: accurately determining latitude becomes tricky when moving towards the poles due to distortion in the grid.

The problem arises from the vertical expansion of the grid as we approach the poles, causing distortion.

To tackle this, I’ve been using the following formula for latitude calculation:

local latitude = -(math.deg(math.atan(math.sinh(mousePosRelativeToCenter.Y / (imageSize.Y / math.pi)))))

Ekran Resmi 2024-03-14 12.57.41

If someone can give me a solution and a mathmatical explanation, It would help me a lot. Thank you :pray:

1 Like