00001 // coremag.hxx -- compute local magnetic variation given position, 00002 // altitude, and date 00003 // 00004 // This is an implimentation of the NIMA WMM 2000 00005 // 00006 // http://www.nima.mil/GandG/ngdc-wmm2000.html 00007 // 00008 // Copyright (C) 2000 Edward A Williams <Ed_Williams@compuserve.com> 00009 // 00010 // Adapted from Excel 3.0 version 3/27/94 EAW 00011 // Recoded in C++ by Starry Chan 00012 // WMM95 added and rearranged in ANSI-C EAW 7/9/95 00013 // Put shell around program and made Borland & GCC compatible EAW 11/22/95 00014 // IGRF95 added 2/96 EAW 00015 // WMM2000 IGR2000 added 2/00 EAW 00016 // Released under GPL 3/26/00 EAW 00017 // Adaptions and modifications for the SimGear project 3/27/2000 CLO 00018 // 00019 // This library is free software; you can redistribute it and/or 00020 // modify it under the terms of the GNU Library General Public 00021 // License as published by the Free Software Foundation; either 00022 // version 2 of the License, or (at your option) any later version. 00023 // 00024 // This library is distributed in the hope that it will be useful, 00025 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00026 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00027 // Library General Public License for more details. 00028 // 00029 // You should have received a copy of the GNU General Public License 00030 // along with this program; if not, write to the Free Software 00031 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00032 // 00033 // $Id: coremag_8hxx_source.html,v 1.3 2010/02/23 22:10:12 curt Exp $ 00034 00035 00036 #ifndef SG_MAGVAR_HXX 00037 #define SG_MAGVAR_HXX 00038 00039 00040 /* Convert date to Julian day 1950-2049 */ 00041 unsigned long int yymmdd_to_julian_days( int yy, int mm, int dd ); 00042 00043 /* return variation (in degrees) given geodetic latitude (radians), longitude 00044 (radians) ,height (km) and (Julian) date 00045 N and E lat and long are positive, S and W negative 00046 */ 00047 double calc_magvar( double lat, double lon, double h, long dat, double* field ); 00048 00049 00050 #endif // SG_MAGVAR_HXX