Languages
[Edit]
EN

JavaScript - distance between points on the Earth in km

6 points
Created by:
Mariam-Barron
811

In this short article, we would like to show how to calculate the distance in km between two points on the Earth using JavaScript.

Hint: to know how to convert DMS format to decimal degrees check this article.

e.g. conversion:
from DMS format 51°53′N 176°39′W
to decimal degrees: {lat: 51.88333, lon: -176.65}.

Quick solution:

 

See also

Edit
  1. Constants - Earth radius in km

  2. JavaScript - convert longitude and latitude from degrees, minutes, and seconds (DMS) to decimal degrees (DD)

Alternative titles

  1. JavaScript - distance between coordinates on the Earth in km
  2. JavaScript - distance between coords on the Earth in km
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join