Find nearest geographic coordinates

Frank Muller <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <CAFA6GnAFAc8Hyac53MSL-N0Mod8apM07szCAVUhqShgQbG9C-w@mail.gmail.com>
Hi guys,

I've a list of geographic coordinates:

L = [ {{<<"longitude">>,6.1457}, {<<"latitude">>,46.2022}},
      {{<<"longitude">>,2.3387}, {<<"latitude">>,48.8582}},
      ... ]

and a specific coordinate X = {{<<"longitude">>,-73.5848},
{<<"latitude">>,45.4995}}.

Question: how can i find the nearest coordinates to X from L (sorted from
the nearest to the farest)?

/Frank
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.