Skip to content
Select language:English

MCL 1.3.5

@Serializable
open class Coord2D(val longitude: Double, val latitude: Double)

Represents a geographical location using latitude and longitude coordinates.

This data class is used to store a pair of latitude and longitude values, which together define a specific point on the Earth's surface.

Inheritors

Constructors

constructor(longitude: Double, latitude: Double)

Properties

The latitude coordinate of the location, in degrees.

The longitude coordinate of the location, in degrees.

Functions

Calculates the distance between this set of coordinates and another.

fun distanceTo(longitude: Double, latitude: Double): Double

Calculates the distance between this and a given set of coordinates.

Calculates the bounding box around this set of coordinates.

fun move(east: Double, north: Double): Coord2D

Calculates a new set of coordinates based on the given offsets (in meters).