<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Ooh interesting.  Well there's your answer, although if you're
    always using it for `distance(A, X) < distance(B, X)` you could
    probably simplify the arithmetic.<br>
    <br>
    Ivan<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 25/11/2020 22:09, Frank Muller
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFA6GnAMvLboTDgCaV0Fm73S41N5BdW-ED7=E-=zeN1awtXm1g@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div>
        <div style="border-color:rgb(255,255,255)" dir="auto">I’m new to
          GIS field, but this module states that Euclidian distance
          isn’t accurate compared to “Law of Haversines”:</div>
        <div style="border-color:rgb(255,255,255)" dir="auto"><br>
        </div>
        <div style="border-color:rgb(255,255,255)" dir="auto"><a
href="https://github.com/armon/teles/blob/master/src/teles_geo_query.erl#L87-L102"
            moz-do-not-send="true">https://github.com/armon/teles/blob/master/src/teles_geo_query.erl#L87-L102</a></div>
        <div style="border-color:rgb(255,255,255)" dir="auto"><br>
        </div>
        <div style="border-color:rgb(255,255,255)" dir="auto"><br>
        </div>
        <div style="border-color:rgb(255,255,255)" dir="auto">/Frank</div>
      </div>
      <div><br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">Wed 25 nov. 2020 à 22:45,
            Ivan Uemlianin <<a href="mailto:ivan@llaisdy.com"
              moz-do-not-send="true">ivan@llaisdy.com</a>> wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">Hi
            Frank<br>
            <br>
            Do you want to sort the list by Euclidean distance from X? 
            If so, could <br>
            you use lists:sort/2?<br>
            <br>
            Ivan<br>
            <br>
            <br>
            On 25/11/2020 21:38, Frank Muller wrote:<br>
            > Hi guys,<br>
            ><br>
            > I've a list of geographic coordinates:<br>
            ><br>
            > L = [ {{<<"longitude">>,6.1457},
            {<<"latitude">>,46.2022}},<br>
            >       {{<<"longitude">>,2.3387},
            {<<"latitude">>,48.8582}},<br>
            >       ... ]<br>
            ><br>
            > and a specific coordinate X =
            {{<<"longitude">>,-73.5848}, <br>
            > {<<"latitude">>,45.4995}}.<br>
            ><br>
            > Question: how can i find the nearest coordinates to X
            from L (sorted <br>
            > from the nearest to the farest)?<br>
            ><br>
            > /Frank<br>
            <br>
            -- <br>
            ============================================================<br>
            Ivan A. Uemlianin PhD<br>
            Llaisdy<br>
            <br>
            Ymchwil a Datblygu Technoleg Lleferydd<br>
            Speech Technology Research and Development<br>
            <br>
                                 <a href="mailto:ivan@llaisdy.com"
              target="_blank" moz-do-not-send="true">ivan@llaisdy.com</a><br>
                                     @llaisdy<br>
                                      <a
              href="http://llaisdy.wordpress.com" rel="noreferrer"
              target="_blank" moz-do-not-send="true">llaisdy.wordpress.com</a><br>
                           <a href="http://github.com/llaisdy"
              rel="noreferrer" target="_blank" moz-do-not-send="true">github.com/llaisdy</a><br>
                                  <a
              href="http://www.linkedin.com/in/ivanuemlianin"
              rel="noreferrer" target="_blank" moz-do-not-send="true">www.linkedin.com/in/ivanuemlianin</a><br>
            <br>
                                     festina lente<br>
            ============================================================<br>
            <br>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
============================================================
Ivan A. Uemlianin PhD
Llaisdy

Ymchwil a Datblygu Technoleg Lleferydd
Speech Technology Research and Development

                    <a class="moz-txt-link-abbreviated" href="mailto:ivan@llaisdy.com">ivan@llaisdy.com</a>
                        @llaisdy
                         llaisdy.wordpress.com
              github.com/llaisdy
                     <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/ivanuemlianin">www.linkedin.com/in/ivanuemlianin</a>

                        festina lente
============================================================</pre>
  </body>
</html>