Interface: NavAngleUnit
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.
Hierarchy
↳
NavAngleUnit
Implemented by
Properties
family
• Readonly
family: "navangle"
This unit's family.
Inherited from
Defined in
src/sdk/math/NumberUnit.ts:692
magVar
• Readonly
magVar: number
This unit's magnetic variation, in degrees.
Defined in
src/sdk/geo/NavAngle.ts:24
name
• Readonly
name: string
This unit's name.
Inherited from
Defined in
src/sdk/math/NumberUnit.ts:695
Methods
canConvert
▸ canConvert(otherUnit
): boolean
Checks whether conversions between this unit and another unit are possible.
Parameters
Name | Type | Description |
---|---|---|
otherUnit | Unit <string > | The other unit. |
Returns
boolean
Whether conversions between this unit and another unit are possible.
Inherited from
Defined in
src/sdk/math/NumberUnit.ts:702
convertFrom
▸ convertFrom(value
, fromUnit
): number
Converts a value of another unit to this unit.
Parameters
Name | Type | Description |
---|---|---|
value | number | The value to convert. |
fromUnit | Unit <"navangle" > | The unit from which to convert. |
Returns
number
The converted value.
Throws
Error if attempting an invalid conversion.
Inherited from
Defined in
src/sdk/math/NumberUnit.ts:720
convertTo
▸ convertTo(value
, toUnit
): number
Converts a value of this unit to another unit.
Parameters
Name | Type | Description |
---|---|---|
value | number | The value to convert. |
toUnit | Unit <"navangle" > | The unit to which to convert. |
Returns
number
The converted value.
Throws
Error if attempting an invalid conversion.
Inherited from
Defined in
src/sdk/math/NumberUnit.ts:711
createNumber
▸ createNumber(value
): NumberUnit
<"navangle"
, NavAngleUnit
>
Creates a NumberUnit with a specified initial value of this unit type.
Parameters
Name | Type | Description |
---|---|---|
value | number | The numeric value of the new NumberUnit. |
Returns
NumberUnit
<"navangle"
, NavAngleUnit
>
A NumberUnit of this unit type.
Inherited from
Defined in
src/sdk/math/NumberUnit.ts:727
equals
▸ equals(other
): boolean
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
Name | Type | Description |
---|---|---|
other | Unit <string > | The other unit to which to compare. |
Returns
boolean
Whether this unit is equal to the comparison.
Inherited from
Defined in
src/sdk/math/NumberUnit.ts:735
isMagnetic
▸ isMagnetic(): boolean
Checks whether this nav angle unit is relative to magnetic north.
Returns
boolean
Whether this nav angle unit is relative to magnetic north.
Defined in
src/sdk/geo/NavAngle.ts:30