Geolocation: Calculate distance between two points

Goal of this task is to calculate the distance in kilometers or miles between two given points.

Imagine you have the current location of your browser and a given location , e.g. of a hackerspace:

We now want to know the distance to this hackerspace.

Please write a small script to calculate the distance in javascript. Provide a form on a small web site to demonstrate this function. Find solutions how to calculate the distance, e.g. with the Haversine formula:

Task tags

  • calculation
  • javascript
  • html5
  • numeric

Students who completed this task

Ronin, mborsch, nathanhleung

Task type

  • code Code
  • assessment Outreach / Research