@squawk
    Preparing search index...
    • Computes the magnetic declination at a geographic position using the World Magnetic Model 2025 (WMM2025).

      Declination is the angle between true north and magnetic north. A positive value means magnetic north is east of true north; negative means west.

      Parameters

      • latDeg: number

        Geodetic latitude in decimal degrees (-90 to 90).

      • lonDeg: number

        Geodetic longitude in decimal degrees (-180 to 180).

      • Optionaloptions: MagneticFieldOptions

        Optional altitude and date.

      Returns number

      Magnetic declination in degrees (positive east, negative west).

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

      // Declination at Boulder, CO on Jan 1 2025
      const dec = magnetic.magneticDeclination(40.0, -105.0, {
      date: new Date(Date.UTC(2025, 0, 1)),
      });