Skip to main content

Interface: NavAngleUnit

Defined in: src/sdk/geo/NavAngle.ts:22

A navigation angle unit, which is a measure of angular degrees relative to either true or magnetic north.

Unlike most other unit types, each instance of navigation angle unit contains state specific to that instance, namely the magnetic variation used to convert between true and magnetic bearing.

Conversions use the magnetic variation of the NavAngleUnit instance whose conversion method is called; this also means that when calling NumberUnit.asUnit(), the magnetic variation of the unit of the NumberUnit whose asUnit() method was called will be used.

Extends

Properties

family

readonly family: "navangle"

Defined in: src/sdk/math/NumberUnit.ts:693

This unit's family.

Inherited from

Unit.family


magVar

readonly magVar: number

Defined in: src/sdk/geo/NavAngle.ts:24

This unit's magnetic variation, in degrees.


name

readonly name: string

Defined in: src/sdk/math/NumberUnit.ts:696

This unit's name.

Inherited from

Unit.name

Methods

canConvert()

canConvert(otherUnit): boolean

Defined in: src/sdk/math/NumberUnit.ts:703

Checks whether conversions between this unit and another unit are possible.

Parameters

ParameterTypeDescription
otherUnitUnit<string>The other unit.

Returns

boolean

Whether conversions between this unit and another unit are possible.

Inherited from

Unit.canConvert


convertFrom()

convertFrom(value, fromUnit): number

Defined in: src/sdk/math/NumberUnit.ts:721

Converts a value of another unit to this unit.

Parameters

ParameterTypeDescription
valuenumberThe value to convert.
fromUnitUnit<"navangle">The unit from which to convert.

Returns

number

The converted value.

Throws

Error if attempting an invalid conversion.

Inherited from

Unit.convertFrom


convertTo()

convertTo(value, toUnit): number

Defined in: src/sdk/math/NumberUnit.ts:712

Converts a value of this unit to another unit.

Parameters

ParameterTypeDescription
valuenumberThe value to convert.
toUnitUnit<"navangle">The unit to which to convert.

Returns

number

The converted value.

Throws

Error if attempting an invalid conversion.

Inherited from

Unit.convertTo


createNumber()

createNumber(value): NumberUnit<"navangle", NavAngleUnit>

Defined in: src/sdk/math/NumberUnit.ts:728

Creates a NumberUnit with a specified initial value of this unit type.

Parameters

ParameterTypeDescription
valuenumberThe numeric value of the new NumberUnit.

Returns

NumberUnit<"navangle", NavAngleUnit>

A NumberUnit of this unit type.

Inherited from

Unit.createNumber


equals()

equals(other): boolean

Defined in: src/sdk/math/NumberUnit.ts:736

Checks whether this unit is equal to another unit. Returns true if and only if the other unit belongs to the same family and has the same name as this unit.

Parameters

ParameterTypeDescription
otherUnit<string>The other unit to which to compare.

Returns

boolean

Whether this unit is equal to the comparison.

Inherited from

Unit.equals


isMagnetic()

isMagnetic(): boolean

Defined in: src/sdk/geo/NavAngle.ts:30

Checks whether this nav angle unit is relative to magnetic north.

Returns

boolean

Whether this nav angle unit is relative to magnetic north.