head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.36; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.50; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.53.59; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.54; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# SGMagVar Class Reference

Magnetic variation wrapper class. More...

`#include <magvar.hxx>`

List of all members.

## Public Methods
| SGMagVar ()
| This creates an instance of the SGMagVar object.
| ~SGMagVar ()
| Destructor.
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
## Related Functions
(Note that these are not member functions.)
double | sgGetMagVar (double lon, double lat, double alt_m, double jd)
| Lookup the magvar for any arbitrary location (This function doesn't save state like the SGMagVar class.

## Detailed Description

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.

Definition at line 51 of file magvar.hxx.

## Constructor & Destructor Documentation

SGMagVar::SGMagVar | ( |  | ) |

| This creates an instance of the SGMagVar object. You must call the update() method before any queries will be valid. Definition at line 32 of file magvar.cxx.

## Member Function Documentation

double SGMagVar::get_magdip | ( |  | ) | const`[inline]`

| Returns: the current magnetic dip in radians. Definition at line 85 of file magvar.hxx.

double SGMagVar::get_magvar | ( |  | ) | const`[inline]`

| Returns: the current magnetic variation in radians. Definition at line 82 of file magvar.hxx.

void SGMagVar::update | ( | double | lon,
|  | double | lat,
|  | double | alt_m,
|  | double | jd
| ) |

  | 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. Parameters:
  lon | longitude in radians
  lat | latitude in radians
  alt_m | altitude above sea level in meters
  jd | julian date
Definition at line 42 of file magvar.cxx.

## Friends And Related Function Documentation

double sgGetMagVar | ( | double | lon,
|  | double | lat,
|  | double | alt_m,
|  | double | jd
| ) | `[related]`

| Lookup the magvar for any arbitrary location (This function doesn't save state like the SGMagVar class. This function triggers a fair amount of CPU work, so use it cautiously. Returns: the magvar in radians Definition at line 51 of file magvar.cxx.

The documentation for this class was generated from the following files:

- magvar.hxx
- magvar.cxx

@ 1.3 log @Oops, try again. @ text @d262 1 a262 1