]> git.mxchange.org Git - simgear.git/blob - simgear/magvar/magvar.hxx
Added gdbm to SimGear. Many systems will already have gdbm installed so
[simgear.git] / simgear / magvar / magvar.hxx
1 // magvar.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 program is free software; you can redistribute it and/or
20 // modify it under the terms of the GNU General Public License as
21 // published by the Free Software Foundation; either version 2 of the
22 // License, or (at your option) any later version.
23 //
24 // This program is distributed in the hope that it will be useful, but
25 // WITHOUT ANY WARRANTY; without even the implied warranty of
26 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27 // 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., 675 Mass Ave, Cambridge, MA 02139, 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 /* Convert degrees to radians */
44 double deg_to_rad( double deg );
45
46 /* Convert radians to degrees */
47 double rad_to_deg( double rad );
48
49 /* return variation (in degrees) given geodetic latitude (radians), longitude
50 (radians) ,height (km) and (Julian) date
51 N and E lat and long are positive, S and W negative
52 */
53 double SGMagVar( double lat, double lon, double h, long dat, double* field );
54
55
56 #endif // SG_MAGVAR_HXX