Skip to main content

Class: MagVar

A utility class for working with magnetic variation (magnetic declination).

Constructors

constructor

new MagVar(): MagVar

Returns

MagVar

Methods

get

get(lat, lon): number

Gets the magnetic variation (magnetic declination) at a specific point on Earth. Positive values signify eastward deflection, and negative values signify westward deflection.

Parameters

NameTypeDescription
latnumberThe latitude of the query point.
lonnumberThe longitude of the query point.

Returns

number

The magnetic variation (magnetic declination) at the point.

Defined in

src/sdk/geo/MagVar.ts:17

get(point): number

Gets the magnetic variation (magnetic declination) at a specific point on Earth. Positive values signify eastward deflection, and negative values signify westward deflection.

Parameters

NameTypeDescription
pointLatLonInterfaceThe query point.

Returns

number

The magnetic variation (magnetic declination) at the point.

Defined in

src/sdk/geo/MagVar.ts:24


magneticToTrue

magneticToTrue(bearing, lat, lon): number

Converts magnetic bearing to true bearing at a specific point on Earth.

Parameters

NameTypeDescription
bearingnumberA magnetic bearing.
latnumberThe latitude of the query point.
lonnumberThe longitude of the query point.

Returns

number

The true bearing equivalent of the given magnetic bearing at the specified point.

Defined in

src/sdk/geo/MagVar.ts:37

magneticToTrue(bearing, point): number

Converts magnetic bearing to true bearing at a specific point on Earth.

Parameters

NameTypeDescription
bearingnumberA magnetic bearing.
pointLatLonInterfaceThe query point.

Returns

number

The true bearing equivalent of the given magnetic bearing at the specified point.

Defined in

src/sdk/geo/MagVar.ts:44

magneticToTrue(bearing, magVar): number

Converts magnetic bearing to true bearing given a specific magnetic variation (magnetic declination).

Parameters

NameTypeDescription
bearingnumberA magnetic bearing.
magVarnumberThe magnetic variation.

Returns

number

The true bearing equivalent of the given magnetic bearing.

Defined in

src/sdk/geo/MagVar.ts:51


trueToMagnetic

trueToMagnetic(bearing, lat, lon): number

Converts true bearing to magnetic bearing at a specific point on Earth.

Parameters

NameTypeDescription
bearingnumberA true bearing.
latnumberThe latitude of the query point.
lonnumberThe longitude of the query point.

Returns

number

The magnetic bearing equivalent of the given true bearing at the specified point.

Defined in

src/sdk/geo/MagVar.ts:64

trueToMagnetic(bearing, point): number

Converts true bearing to magnetic bearing at a specific point on Earth.

Parameters

NameTypeDescription
bearingnumberA true bearing.
pointLatLonInterfaceThe query point.

Returns

number

The magnetic bearing equivalent of the given true bearing at the specified point.

Defined in

src/sdk/geo/MagVar.ts:71

trueToMagnetic(bearing, magVar): number

Converts true bearing to magnetic bearing given a specific magnetic variation (magnetic declination).

Parameters

NameTypeDescription
bearingnumberA true bearing.
magVarnumberThe magnetic variation.

Returns

number

The magnetic bearing equivalent of the given true bearing.

Defined in

src/sdk/geo/MagVar.ts:78