]> git.mxchange.org Git - simgear.git/blob - simgear/magvar/coremag.hxx
Back out the previous patch.
[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 Library General Public
30 // License along with this library; if not, write to the
31 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
32 // Boston, MA  02111-1307, USA.
33 //
34 // $Id$
35
36
37 #ifndef SG_MAGVAR_HXX
38 #define SG_MAGVAR_HXX
39
40
41 /* Convert date to Julian day    1950-2049 */
42 unsigned long int yymmdd_to_julian_days( int yy, int mm, int dd );
43
44 /* return variation (in degrees) given geodetic latitude (radians), longitude
45 (radians) ,height (km) and (Julian) date
46 N and E lat and long are positive, S and W negative
47 */
48 double calc_magvar( double lat, double lon, double h, long dat, double* field );
49
50
51 #endif // SG_MAGVAR_HXX