Skip to main content

Class: BasicNavAngleUnit

A basic implementation of a navigation angle unit.

Hierarchy

Implements

Constructors

constructor

new BasicNavAngleUnit(referenceNorth, magVar): BasicNavAngleUnit

Constructor.

Parameters

NameTypeDescription
referenceNorthNavAngleUnitReferenceNorthThe reference north of the new unit.
magVarnumberThe initial magnetic variation of the new unit.

Returns

BasicNavAngleUnit

Overrides

AbstractUnit.constructor

Defined in

src/sdk/geo/NavAngle.ts:59

Properties

family

Readonly family: "navangle"

This unit's family.

Implementation of

NavAngleUnit.family

Overrides

AbstractUnit.family

Defined in

src/sdk/geo/NavAngle.ts:46


name

Readonly name: string

The name of this unit.

Implementation of

NavAngleUnit.name

Inherited from

AbstractUnit.name

Defined in

src/sdk/math/NumberUnit.ts:756

Accessors

magVar

get magVar(): number

This unit's magnetic variation, in degrees.

Returns

number

Implementation of

NavAngleUnit.magVar

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

NameTypeDescription
otherUnitUnit<string>The other unit.

Returns

boolean

Whether conversions between this unit and another unit are possible.

Implementation of

NavAngleUnit.canConvert

Inherited from

AbstractUnit.canConvert

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

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

Returns

number

The converted value.

Throws

Error if attempting an invalid conversion.

Implementation of

NavAngleUnit.convertFrom

Overrides

AbstractUnit.convertFrom

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

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

Returns

number

The converted value.

Throws

Error if attempting an invalid conversion.

Implementation of

NavAngleUnit.convertTo

Overrides

AbstractUnit.convertTo

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

NameTypeDescription
valuenumberThe numeric value of the new NumberUnit.

Returns

NumberUnit<"navangle", BasicNavAngleUnit>

A NumberUnit of this unit type.

Implementation of

NavAngleUnit.createNumber

Inherited from

AbstractUnit.createNumber

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

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

Returns

boolean

Whether this unit is equal to the comparison.

Implementation of

NavAngleUnit.equals

Overrides

AbstractUnit.equals

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

NavAngleUnit.isMagnetic

Defined in

src/sdk/geo/NavAngle.ts:69


setMagVar

setMagVar(magVar): void

Sets this unit's magnetic variation.

Parameters

NameTypeDescription
magVarnumberThe 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

NameTypeDescription
locationLatLonInterfaceThe 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

NameTypeDescription
latnumberThe latitude, in degrees, of the location defining the new magnetic variation.
lonnumberThe 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

NameTypeDescription
isMagneticbooleanWhether the new unit is relative to magnetic north.
magVar?numberThe initial magnetic variation of the new unit, in degrees. Defaults to 0 degrees.

Returns

BasicNavAngleUnit

An instance of BasicNavAngleUnit.

Defined in

src/sdk/geo/NavAngle.ts:158

create(isMagnetic, location): BasicNavAngleUnit

Creates an instance of BasicNavAngleUnit.

Parameters

NameTypeDescription
isMagneticbooleanWhether the new unit is relative to magnetic north.
locationLatLonInterfaceThe initial location of the new unit.

Returns

BasicNavAngleUnit

An instance of BasicNavAngleUnit.

Defined in

src/sdk/geo/NavAngle.ts:165

create(isMagnetic, lat, lon): BasicNavAngleUnit

Creates an instance of BasicNavAngleUnit.

Parameters

NameTypeDescription
isMagneticbooleanWhether the new unit is relative to magnetic north.
latnumberThe initial latitude of the new unit, in degrees.
lonnumberThe initial longitude of the new unit, in degrees.

Returns

BasicNavAngleUnit

An instance of BasicNavAngleUnit.

Defined in

src/sdk/geo/NavAngle.ts:173