alexferrer / xplane_thermals

Xplane plugin to generate more realistic thermals
GNU General Public License v2.0
28 stars 7 forks source link

lat/lon to meters calculation swaps x/y #24

Open uhertlein opened 8 years ago

uhertlein commented 8 years ago

The convertLatLon2Meters(lat, lon) method calculates 'x' from latitude and 'y' from longitude. For an x/y coordinate system it should probably be 'y' from latitude (N=+y, S=-y) and 'x' from longitude (E=+x, W=-x).

This would match with e.g. the wind drift calculation and would get rid of 'surprising' constructs like adding wind drift 'y' to plane position 'x':

planeX, planeY = convertLatLon2Meters(lat, lon)
dX,dY = calcDrift(alt)
planeX +=  dY
planeY +=  dX