[PATCH] Simplify distance calculations
Robert C. Helling
helling at atdotde.de
Fri Jun 12 23:46:36 PDT 2015
On 12 Jun 2015, at 23:26, Anton Lundin <glance at acc.umu.se> wrote:
Anton,
> + // Earth radious is about 111.5 km where i live
> + return sqrt(lat1.udeg*lat2.udeg + lon1.udeg*lon2.udeg) / 10;
please at least multiply the longitudes with sin(90degrees - latitude) as otherwise you underestimate the distance at the equator and overestimate the distance closer to the poles.
Best
Robert
--
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling Elite Master Course Theoretical and Mathematical Physics
Scientific Coordinator
Ludwig Maximilians Universitaet Muenchen, Dept. Physik
print "Just another Phone: +49 89 2180-4523 Theresienstr. 39, rm. B339
stupid .sig\n"; http://www.atdotde.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150613/7c6df406/attachment.sig>
More information about the subsurface
mailing list