help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: distance from Easter Island to Chile


From: Eli Zaretskii
Subject: Re: distance from Easter Island to Chile
Date: Sun, 20 Apr 2014 09:28:23 +0300

> From: Emanuel Berg <embe8573@student.uu.se>
> Date: Sun, 20 Apr 2014 02:03:32 +0200
> 
> (defun distance (l1-r f1-r l2-r f2-r)
>   (interactive)
>   (let ((l1 (degrees-to-radians l1-r))
>         (f1 (degrees-to-radians f1-r))
>         (l2 (degrees-to-radians l2-r))
>         (f2 (degrees-to-radians f2-r)) )
>     (* 2 6378.1 ; Earth's radius
>        (asin
>         (sqrt
>          (+ (sin2 (/ (- f2 f1) 2))
>             (* (cos f2) (cos f1) (sin2 (/ (- l2 l1) 2))) ))))))

This is inaccurate (Earth is not a sphere).  See
http://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid for some theory
and more accurate formulas.  A very accurate method is described in
http://en.wikipedia.org/wiki/Vincenty%27s_formulae (you need the
"inverse problem").



reply via email to

[Prev in Thread] Current Thread [Next in Thread]