getDistance

fun getDistance(lat1: Double, lat2: Double, lon1: Double, lon2: Double): Double

Calculate distance between two points in latitude and longitude taking into account height difference. If you are not interested in height difference pass 0.0. Uses Haversine method as its base.

lat1, lon1 Start point lat2, lon2 End point el1 Start altitude in meters el2 End altitude in meters