Coords

data class Coords(latitude: Double, longitude: Double)

Functions

Link copied to clipboard
fun asLatLonString(): String

Returns these coordinates formatted as "latitude,longitude", truncated to 6 decimal places

Properties

Link copied to clipboard
val latitude: Double
Link copied to clipboard
val longitude: Double

Extensions

Link copied to clipboard
fun Coords.bearingTo(other: Coords): Double
Link copied to clipboard
fun Coords.coordinateAtOffset(distance: Distance, bearing: Double): Coords
Link copied to clipboard
fun Coords.distanceTo(other: Coords): Distance
Link copied to clipboard
fun Coords.isEffectivelyEqualTo(other: Coords): Boolean

https://xkcd.com/2170/

Link copied to clipboard
fun Coords.nearestPointOnLine(from: Coords, to: Coords): Pair<Coords, Double>