Position

open class Position(latitude: Angle, longitude: Angle, var altitude: Double) : Location

Geographic position with a latitude and longitude and altitude in meters.

Constructors

Link copied to clipboard
constructor(latitude: Angle, longitude: Angle, altitude: Double)
constructor()

Constructs a position with latitude, longitude and altitude all 0.

constructor(position: Position)

Constructs a position with the latitude, longitude and altitude of a specified position.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The position's altitude in meters.

Link copied to clipboard

The location's latitude.

Link copied to clipboard

The location's longitude.

Functions

Link copied to clipboard
fun copy(location: Location): Location

Sets this location to the latitude and longitude of a specified location.

fun copy(position: Position): Position

Sets this position to the latitude, longitude and altitude of a specified position.

Link copied to clipboard
fun equals(other: Location, tolerance: Double): Boolean
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Computes the azimuth angle (clockwise from North) for the great circle path between this location and a specified location. This angle can be used as the starting azimuth for a great circle path beginning at this location, and passing through the specified location. This function uses a spherical model, not elliptical.

Link copied to clipboard

Computes the angular distance of the great circle path between this location and a specified location. In radians, this angle is the arc length of the segment between the two locations. To compute a distance in meters from this value, multiply the return value by the radius of the globe. This function uses a spherical model, not elliptical.

Link copied to clipboard
fun greatCircleLocation(azimuth: Angle, distanceRadians: Double, result: Location): Location

Computes the location on the great circle path starting at this location and traversing with the specified azimuth and angular distance. This function uses a spherical model, not elliptical.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun interpolateAlongPath(endLocation: Location, pathType: PathType, amount: Double, result: Location): Location

Compute a location along a path between two locations. The amount indicates the fraction of the path at which to compute a location. This value is typically between 0 and 1, where 0 indicates the begin location (this location) and 1 indicates the end location.

fun interpolateAlongPath(endPosition: Position, pathType: PathType, amount: Double, result: Position): Position

Compute a position along a path between two positions. The amount indicates the fraction of the path at which to compute a position. This value is typically between 0 and 1, where 0 indicates the begin position (this position) and 1 indicates the end position.

Link copied to clipboard
fun linearAzimuth(location: Location): Angle

Computes the azimuth angle (clockwise from North) for the linear path between this location and a specified location. This angle can be used as the starting azimuth for a linear path beginning at this location, and passing through the specified location. This function uses a flat-earth approximation proximal to this location.

Link copied to clipboard

Computes the angular distance of the linear path between this location and a specified location. In radians, this angle is the arc length of the segment between the two locations. To compute a distance in meters from this value, multiply the return value by the radius of the globe. This function uses a flat-earth approximation proximal to this location.

Link copied to clipboard
fun linearLocation(azimuth: Angle, distanceRadians: Double, result: Location): Location

Computes the location on the linear path starting at this location and traversing with the specified azimuth and angular distance. This function uses a flat-earth approximation proximal to this location.

Link copied to clipboard
fun rhumbAzimuth(location: Location): Angle

Computes the azimuth angle (clockwise from North) for the rhumb path (line of constant azimuth) between this location and a specified location. This angle can be used as the starting azimuth for a rhumb path beginning at this location, and passing through the specified location. This function uses a spherical model, not elliptical.

Link copied to clipboard
fun rhumbDistance(location: Location): Double

Computes the angular distance of the rhumb path (line of constant azimuth) between this location and a specified location. In radians, this angle is the arc length of the segment between the two locations. To compute a distance in meters from this value, multiply the return value by the radius of the globe. This function uses a spherical model, not elliptical.

Link copied to clipboard
fun rhumbLocation(azimuth: Angle, distanceRadians: Double, result: Location): Location

Computes the location on a rhumb path (line of constant azimuth) starting at this location and traversing with the specified azimuth and angular distance. This function uses a spherical model, not elliptical.

Link copied to clipboard
fun set(latitude: Angle, longitude: Angle): Location

Sets this location to a specified latitude and longitude.

fun set(latitude: Angle, longitude: Angle, altitude: Double): Position

Sets this position to a specified latitude and longitude and altitude in meters.

Link copied to clipboard
fun setDegrees(latitudeDegrees: Double, longitudeDegrees: Double): Location

Sets this location to a specified latitude and longitude in degrees.

fun setDegrees(latitudeDegrees: Double, longitudeDegrees: Double, altitude: Double): Position

Sets this position to a specified latitude and longitude in degrees and altitude in meters.

Link copied to clipboard
fun setRadians(latitudeRadians: Double, longitudeRadians: Double): Location

Sets this location to a specified latitude and longitude in radians.

fun setRadians(latitudeRadians: Double, longitudeRadians: Double, altitude: Double): Position

Sets this position to a specified latitude and longitude in radians and altitude in meters.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String