Class: BasicNavAngleUnit
Defined in: src/sdk/geo/NavAngle.ts:44
A basic implementation of a navigation angle unit.
Extends
Implements
Constructors
Constructor
new BasicNavAngleUnit(
referenceNorth
,magVar
):BasicNavAngleUnit
Defined in: src/sdk/geo/NavAngle.ts:59
Constructor.
Parameters
Parameter | Type | Description |
---|---|---|
referenceNorth | NavAngleUnitReferenceNorth | The reference north of the new unit. |
magVar | number | The initial magnetic variation of the new unit. |
Returns
BasicNavAngleUnit
Overrides
Properties
family
readonly
family:"navangle"
='navangle'
Defined in: src/sdk/geo/NavAngle.ts:46
This unit's family.
Implementation of
Overrides
name
readonly
name:string
Defined in: src/sdk/math/NumberUnit.ts:757
The name of this unit.
Implementation of
Inherited from
Accessors
magVar
Get Signature
get magVar():
number
Defined in: src/sdk/geo/NavAngle.ts:50
This unit's magnetic variation, in degrees.
Returns
number
This unit's magnetic variation, in degrees.
Implementation of
Methods
canConvert()
canConvert(
otherUnit
):boolean
Defined in: src/sdk/math/NumberUnit.ts:761
Checks whether conversions between this unit and another unit are possible.
Parameters
Parameter | Type | Description |
---|---|---|
otherUnit | Unit <string > | The other unit. |
Returns
boolean
Whether conversions between this unit and another unit are possible.
Implementation of
Inherited from
convertFrom()
convertFrom(
value
,fromUnit
):number
Defined in: src/sdk/geo/NavAngle.ts:103
Converts a value of another unit to this unit. This unit's magnetic variation is used for the conversion.
Parameters
Parameter | 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
convertTo()
convertTo(
value
,toUnit
):number
Defined in: src/sdk/geo/NavAngle.ts:80
Converts a value of this unit to another unit. This unit's magnetic variation is used for the conversion.
Parameters
Parameter | 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
createNumber()
createNumber(
value
):NumberUnit
<"navangle"
,BasicNavAngleUnit
>
Defined in: src/sdk/math/NumberUnit.ts:772
Creates a NumberUnit with a specified initial value of this unit type.
Parameters
Parameter | 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
equals()
equals(
other
):boolean
Defined in: src/sdk/geo/NavAngle.ts:148
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
Parameter | 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
isMagnetic()
isMagnetic():
boolean
Defined in: src/sdk/geo/NavAngle.ts:69
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
setMagVar()
setMagVar(
magVar
):void
Defined in: src/sdk/geo/NavAngle.ts:123
Sets this unit's magnetic variation.
Parameters
Parameter | Type | Description |
---|---|---|
magVar | number | The magnetic variation to set, in degrees. |
Returns
void
setMagVarFromLocation()
Call Signature
setMagVarFromLocation(
location
):void
Defined in: src/sdk/geo/NavAngle.ts:131
Sets this unit's magnetic variation from a geographic location.
Parameters
Parameter | Type | Description |
---|---|---|
location | LatLonInterface | The location defining the new magnetic variation. |
Returns
void
Call Signature
setMagVarFromLocation(
lat
,lon
):void
Defined in: src/sdk/geo/NavAngle.ts:137
Sets this unit's magnetic variation from a geographic location.
Parameters
Parameter | 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
create()
Call Signature
static
create(isMagnetic
,magVar?
):BasicNavAngleUnit
Defined in: src/sdk/geo/NavAngle.ts:158
Creates an instance of BasicNavAngleUnit.
Parameters
Parameter | 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
BasicNavAngleUnit
An instance of BasicNavAngleUnit.
Call Signature
static
create(isMagnetic
,location
):BasicNavAngleUnit
Defined in: src/sdk/geo/NavAngle.ts:165
Creates an instance of BasicNavAngleUnit.
Parameters
Parameter | Type | Description |
---|---|---|
isMagnetic | boolean | Whether the new unit is relative to magnetic north. |
location | LatLonInterface | The initial location of the new unit. |
Returns
BasicNavAngleUnit
An instance of BasicNavAngleUnit.
Call Signature
static
create(isMagnetic
,lat
,lon
):BasicNavAngleUnit
Defined in: src/sdk/geo/NavAngle.ts:173
Creates an instance of BasicNavAngleUnit.
Parameters
Parameter | 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
BasicNavAngleUnit
An instance of BasicNavAngleUnit.