Converts a true bearing to a magnetic bearing by subtracting the magnetic declination at the given position. The result is normalized to [0, 360).
True bearing in degrees.
Geodetic latitude in decimal degrees.
Geodetic longitude in decimal degrees.
Optional
Optional altitude and date.
Magnetic bearing in degrees, normalized to [0, 360).
import { magnetic } from '@squawk/flight-math';// Convert a true heading of 360 to magnetic at a given positionconst magHeading = magnetic.trueToMagnetic(360, 40.0, -105.0); Copy
import { magnetic } from '@squawk/flight-math';// Convert a true heading of 360 to magnetic at a given positionconst magHeading = magnetic.trueToMagnetic(360, 40.0, -105.0);
Converts a true bearing to a magnetic bearing by subtracting the magnetic declination at the given position. The result is normalized to [0, 360).