@squawk
    Preparing search index...
    • Converts a magnetic bearing to a true bearing by adding the magnetic declination at the given position. The result is normalized to [0, 360).

      Parameters

      • magneticBearingDeg: number

        Magnetic bearing in degrees.

      • latDeg: number

        Geodetic latitude in decimal degrees.

      • lonDeg: number

        Geodetic longitude in decimal degrees.

      • Optionaloptions: MagneticFieldOptions

        Optional altitude and date.

      Returns number

      True bearing in degrees, normalized to [0, 360).

      import { magnetic } from '@squawk/flight-math';

      // Convert a magnetic heading of 350 to true at a given position
      const trueHeading = magnetic.magneticToTrue(350, 40.0, -105.0);