DistanceCalculator

Distance calculator for WGS84 (Earth as spheroid). Should be initialized by latitude and used in some not far around area.

Fast and precise for nearby points (distance <= 200 km). Expected error is 0.04%.

In other cases (distance 200 km), uses DistanceCalculator.distanceOnSphere function.

Call DistanceCalculator.instance to obtain DistanceCalculator instance.

Types

Link copied to clipboard
object Companion

Companion object.

Functions

Link copied to clipboard
abstract fun distance(from: Point, to: Point): Double

Calculates distance between two coordinates.