Calculate distance between two coordinates (Offline)

This is the function by giving the longitude and latitude of the departure and arrival, calculate the distance in kilometers.

Of course, this calculation is indicative, that is in linear form (air).
But its strength is that it is a calculation offline, ie without the use of tools such as GPS or internet

1 Comment

  1. Wayne

    Hey Michal.The result is in kileemtros. If you’re wanting to convert it to miles, you can simply remove the * 1.609344 line. Alternatively, if you’re wanting to convert to metres, you’ll need to add on an additioal * 1000 after the conversion to kileemtros.Hope it helps :)

Leave a Comment

Your email address will not be published. Required fields are marked *