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

      Returns declination, inclination, and all field components (X, Y, Z, H, F).

      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 MagneticFieldResult

      Full magnetic field result with all components.

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

      const result = magnetic.magneticField(40.0, -105.0, {
      date: new Date(Date.UTC(2026, 0, 1)),
      });
      console.log(result.declinationDeg);
      console.log(result.totalIntensityNt);