Class: BasicNavAngleUnit
A basic implementation of a navigation angle unit.
Hierarchy
AbstractUnit
<NavAngleUnitFamily
>↳
BasicNavAngleUnit
Implements
Constructors
constructor
• new BasicNavAngleUnit(referenceNorth
, magVar
): BasicNavAngleUnit
Constructor.
Parameters
Name | Type | Description |
---|---|---|
referenceNorth | NavAngleUnitReferenceNorth | The reference north of the new unit. |
magVar | number | The initial magnetic variation of the new unit. |
Returns
Overrides
Defined in
src/sdk/geo/NavAngle.ts:59
Properties
family
• Readonly
family: "navangle"
This unit's family.
Implementation of
Overrides
Defined in
src/sdk/geo/NavAngle.ts:46
name
• Readonly
name: string
The name of this unit.
Implementation of
Inherited from
Defined in
src/sdk/math/NumberUnit.ts:756
Accessors
magVar
• get
magVar(): number
This unit's magnetic variation, in degrees.
Returns
number
Implementation of
Defined in
src/sdk/geo/NavAngle.ts:50
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.
Implementation of
Inherited from
Defined in
src/sdk/math/NumberUnit.ts:760
convertFrom
▸ convertFrom(value
, fromUnit
): number
Converts a value of another unit to this unit. This unit's magnetic variation is used for the conversion.
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.
Implementation of
Overrides
Defined in
src/sdk/geo/NavAngle.ts:103
convertTo
▸ convertTo(value
, toUnit
): number
Converts a value of this unit to another unit. This unit's magnetic variation is used for the conversion.
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.
Implementation of
Overrides
Defined in
src/sdk/geo/NavAngle.ts:80
createNumber
▸ createNumber(value
): NumberUnit
<"navangle"
, BasicNavAngleUnit
>
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"
, BasicNavAngleUnit
>
A NumberUnit of this unit type.
Implementation of
Inherited from
Defined in
src/sdk/math/NumberUnit.ts:771
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.
Implementation of
Overrides
Defined in
src/sdk/geo/NavAngle.ts:148
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.
Implementation of
Defined in
src/sdk/geo/NavAngle.ts:69
setMagVar
▸ setMagVar(magVar
): void
Sets this unit's magnetic variation.
Parameters
Name | Type | Description |
---|---|---|
magVar | number | The magnetic variation to set, in degrees. |
Returns
void
Defined in
src/sdk/geo/NavAngle.ts:123
setMagVarFromLocation
▸ setMagVarFromLocation(location
): void
Sets this unit's magnetic variation from a geographic location.
Parameters
Name | Type | Description |
---|---|---|
location | LatLonInterface | The location defining the new magnetic variation. |
Returns
void
Defined in
src/sdk/geo/NavAngle.ts:131
▸ setMagVarFromLocation(lat
, lon
): void
Sets this unit's magnetic variation from a geographic location.
Parameters
Name | Type | Description |
---|---|---|
lat | number | The latitude, in degrees, of the location defining the new magnetic variation. |
lon | number | The longitude, in degrees, of the location defining the new magnetic variation. |
Returns
void
Defined in
src/sdk/geo/NavAngle.ts:137
create
▸ create(isMagnetic
, magVar?
): BasicNavAngleUnit
Creates an instance of BasicNavAngleUnit.
Parameters
Name | Type | Description |
---|---|---|
isMagnetic | boolean | Whether the new unit is relative to magnetic north. |
magVar? | number | The initial magnetic variation of the new unit, in degrees. Defaults to 0 degrees. |
Returns
An instance of BasicNavAngleUnit.
Defined in
src/sdk/geo/NavAngle.ts:158
▸ create(isMagnetic
, location
): BasicNavAngleUnit
Creates an instance of BasicNavAngleUnit.
Parameters
Name | Type | Description |
---|---|---|
isMagnetic | boolean | Whether the new unit is relative to magnetic north. |
location | LatLonInterface | The initial location of the new unit. |
Returns
An instance of BasicNavAngleUnit.
Defined in
src/sdk/geo/NavAngle.ts:165
▸ create(isMagnetic
, lat
, lon
): BasicNavAngleUnit
Creates an instance of BasicNavAngleUnit.
Parameters
Name | Type | Description |
---|---|---|
isMagnetic | boolean | Whether the new unit is relative to magnetic north. |
lat | number | The initial latitude of the new unit, in degrees. |
lon | number | The initial longitude of the new unit, in degrees. |
Returns
An instance of BasicNavAngleUnit.
Defined in
src/sdk/geo/NavAngle.ts:173