Calculates magnetic declination at a given airport
A 4-letter ICAO airport code
Date (as a Date object). Defaults to current date.
This function calls
magvar, which uses the NIMA WMM2005 (World Magnetic Model). This is the exact same algorithm that FlightGear (via the SimGear library) uses, and in fact
magvar is a port of the corresponding SimGear C++ function: https://github.com/FlightGear/simgear/blob/next/simgear/magvar/coremag.cxx
Returns the magnetic declination (in degrees) at the specified airport.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.