Magnetic variation wrapper class. More...
Public Member Functions
|This creates an instance of the SGMagVar object. |
|void||update (double lon, double lat, double alt_m, double jd)|
|Recalculate the magnetic offset and dip. |
|double||get_magvar () const|
|double||get_magdip () const|
(Note that these are not member functions.)
|double||sgGetMagVar (double lon, double lat, double alt_m, double jd)|
Magnetic variation wrapper class.
The SGMagVar class calculates the magnetic variation and dip for any position, altitude, and time. It is a complete re-implimentation of the NIMA WMM 2000 (not derived from their demo code.)
The SGMagVar class is really a simple wrapper around the core Ed Williams code which does all the hard work. This class allows you to crunch the math once and then do multiple polls of the data. However, if your position, altitude, or time has changed significantly, you should call the update() method to recrunch new numbers.
|double SGMagVar::get_magdip||(||)|| const
|double SGMagVar::get_magvar||(||)|| const
Recalculate the magnetic offset and dip.
The update() method requires you to pass in your position and the julian date. Lon and lat are specified in radians, altitude is specified in meters. Julian date can be conveniently calculated by using an instance of the SGTime class.
|lon||longitude in radians|
|lat||latitude in radians|
|alt_m||altitude above sea level in meters|