I wish to convert gps Lat/Long coords to X/Y coords. Precision is not paramount. I would be happy if it were within a quarter of a km accuracy.
I found this code online...
The Math.PI would be our cPI and app.radius would be the enlargement of the map area I suspect.
Any ideas?
I found this code online...
// convert lat/long to radians
latitude = Math.PI * latitude / 180;
longitude = Math.PI * longitude / 180;
// adjust position by radians
latitude -= 1.570795765134; // subtract 90 degrees (in radians)
// and switch z and y
xPos = (app.radius) * Math.sin(latitude) * Math.cos(longitude);
zPos = (app.radius) * Math.sin(latitude) * Math.sin(longitude);
yPos = (app.radius) * Math.cos(latitude);
The Math.PI would be our cPI and app.radius would be the enlargement of the map area I suspect.
Any ideas?