Bearing

Represents an absolute bearing or heading, internally stored as a Rotation from North in the range [0,360) degrees defined in the positive-clockwise direction when viewed from above (axis of rotation is a vector pointing down).

See also

Types

Link copied to clipboard
object Companion

Companion object containing cardinal and intercardinal bearing directions.

Functions

Link copied to clipboard

Calculate the nonnegative Rotation such that rotating this by the Rotation brings you to other.

Link copied to clipboard
operator fun minus(other: Bearing): Rotation

Inverse of clockwiseRotationTo. Calculate the nonnegative Rotation such that rotating other by the Rotation brings you to this.

operator fun minus(other: Rotation): Bearing

Rotate this bearing by the given Rotation anticlockwise, wrapping in [0,360) degrees if necessary.

Link copied to clipboard
operator fun plus(other: Rotation): Bearing

Rotate this bearing by the given Rotation clockwise, wrapping in [0,360) degrees if necessary.

Link copied to clipboard

Calculate the smallest Rotation such that rotating this by the Rotation brings you to other.

Link copied to clipboard
fun toDmsString(decimalPlaces: Int = 2): String

Format this Bearing as a quadrant bearing with Degrees, ArcMinutes, and ArcSeconds components.

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

Returns a string representation of this bearing as a quadrant bearing.

fun toString(unit: RotationUnit = Degrees, decimalPlaces: Int = 2): String

Returns a string representation of this bearing as a quadrant bearing with the specified unit and decimalPlaces.