# Azimuth on projected tile map

Here is a very specific problem :

I have some mercator flight simulator maps I projected with real coordinates. However, due to game simplification, these maps are not oriented correctly and real bearings don't correspond to ingame ones.

In the following map, arrows show the ingame North (0°) and the number indicates the projected real azimuth.

But my flight plan tool need to display ingame bearings to be accurate and useful !

So, is there a way, or a mathematic function allowing me to recalculate ingame bearings from the map projection, when the figure is in the map bounding box ?

I have the WGS84 coordinates of the 4 corners, and maps are always perfectly oriented NSEW ingame.

I can imagine there could be some maths in the solution.

• Is your map above in Mercator? Do the WGS84 corners of the in-game maps make a perfect rectangle/square? – mkennedy Dec 27 '17 at 23:14
• World Map is WebMercator. The ingame map is always a perfect rectangle, with an ingame North/South alignment. – Zofren Dec 27 '17 at 23:55
• how are you calculating the azimuths? – Ian Turton Dec 28 '17 at 11:18
• var getAzimuth = function(a, b) { let dx = b[0] - a[0]; let dy = b[1] - a[1]; let rotation = Math.atan2(dy, dx); return this.toBearing(rotation); } – Zofren Dec 28 '17 at 12:11