views:

51

answers:

2

How can I get the distance between two google.maps.LatLng points using the Mars/Moon tileset? Python/Javascript preferred, but any language would do just fine.

+2  A: 

You can find the distance formula on http://www.movable-type.co.uk/scripts/latlong.html. Be sure to use the correct planet radius. Most formulas assume that you use the earth, which is 6371 km. Moon and Mars have a different radius. Also, the formulas assume that the earth (or planet) is a perfect sphere, which isn't the case (radius towards the poles is smaller than radius towards the equator).

Patrick
I'll go with that, thanks!
Gabi Purcaru
A: 

Patrick's answer is an approximation. This is true for the Earth as well, but more so with the Moon and Mars. Not only do you have the polar flattening, but both are decidedly lopsided. Being smaller, gravitational forces do not as strongly maintain the perfect spherical shape. Hence mascons on the Moon, and volcanoes on Mars cause some huge deviations to the geoid (gravitational equipotential) and 'real' surface.

winwaed
I'm aware of that, but since I can't find anything better, it's ok for me. Thanks anyway for the specification.
Gabi Purcaru