]> git.mxchange.org Git - simgear.git/blob - simgear/magvar/coremag.hxx
42eeacae020ef72765ba929f20ba52c940fe1466
[simgear.git] / simgear / magvar / coremag.hxx
1 // coremag.hxx -- compute local magnetic variation given position,
2 //                altitude, and date
3 //
4 // This is an implimentation of the NIMA WMM 2000
5 //
6 //    http://www.nima.mil/GandG/ngdc-wmm2000.html
7 //
8 // Copyright (C) 2000  Edward A Williams <Ed_Williams@compuserve.com>
9 //
10 // Adapted from Excel 3.0 version 3/27/94 EAW
11 // Recoded in C++ by Starry Chan
12 // WMM95 added and rearranged in ANSI-C EAW 7/9/95
13 // Put shell around program and made Borland & GCC compatible EAW 11/22/95
14 // IGRF95 added 2/96 EAW
15 // WMM2000 IGR2000 added 2/00 EAW
16 // Released under GPL 3/26/00 EAW
17 // Adaptions and modifications for the SimGear project  3/27/2000 CLO
18 //
19 // This library is free software; you can redistribute it and/or
20 // modify it under the terms of the GNU Library General Public
21 // License as published by the Free Software Foundation; either
22 // version 2 of the License, or (at your option) any later version.
23 //
24 // This library is distributed in the hope that it will be useful,
25 // but WITHOUT ANY WARRANTY; without even the implied warranty of
26 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27 // Library General Public License for more details.
28 //
29 // You should have received a copy of the GNU General Public License
30 // along with this program; if not, write to the Free Software
31 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
32 //
33 // $Id$
34
35
36 #ifndef SG_MAGVAR_HXX
37 #define SG_MAGVAR_HXX
38
39
40 /* Convert date to Julian day    1950-2049 */
41 unsigned long int yymmdd_to_julian_days( int yy, int mm, int dd );
42
43 /* return variation (in degrees) given geodetic latitude (radians), longitude
44 (radians) ,height (km) and (Julian) date
45 N and E lat and long are positive, S and W negative
46 */
47 double calc_magvar( double lat, double lon, double h, long dat, double* field );
48
49
50 #endif // SG_MAGVAR_HXX