0.2 Functional beta (02/02/02) with test routines
0.3 Functional beta (11/1/03) with geomagnetism routines
0.4 Functional beta (11/20/04) tuned for DLL and VB support
0.5 Functional Beta (01/08/05) Updated World Magnetic Model to 2005
Table of Contents
Example compilation with GNU C++
with novas already in a library:
gcc geoTest.c geoAstro.c geoEllips.c geoPoint.c geoMag.c novas\novas.a
with Novas not in a library:
gcc geoTest.c geoAstro.c geoEllips.c geoPoint.c geoMag.c \ novas\novas.c novas\novascon.c novas\readeph0.c novas\solsys3.c
Example compilation with Borland C++
with novas already in a library:
bcc32 geoTest.c geoAstro.c geoEllips.c geoPoint.c geoMag.c novas\novas.lib
with Novas not in a library:
bcc32 geoTest.c geoAstro.c geoEllips.c geoPoint.c geoMag.c \ novas\novas.c novas\novascon.c novas\readeph0.c novas\solsys3.c
Example compilation with Microsoft C++
with novas already in a library:
cl geoTest.c geoAstro.c geoEllips.c geoPoint.c geoMag.c novas\novas.lib
with Novas not in a library:
cl geoTest.c geoAstro.c geoEllips.c geoPoint.c geoMag.c \ novas\novas.c novas\novascon.c novas\readeph0.c novas\solsys3.c
Calling the geo.dll from Visual Basic
Example:
Private Declare Function MagD Lib "geo.dll" Alias "_geoMagGetDecRet@36" _ (ByVal Latitude As Double, ByVal Longitude As Double, ByVal Altitude As Double, _ ByVal Month As Integer, ByVal Day As Integer, ByVal Year As Integer) As Double ' Although the path to "geo.dll" could be included, if it is in the system path, the local ' directory, c:\windows or \windows\system32, the path is not required, as it will find it in going ' through the defaults. Dim dlat As Double 'Latitude as decimal. Plus for Northern Latitudes Dim dlong As Double 'Longitude as decimal. Minus for West Longitude's Dim alt As Double 'Altitude in Meters An average value for a state can be used Dim mo As Integer 'Month Dim da As Integer 'Day Dim yr As Integer 'Year '_______________________________________________________________ Private Sub cmdDeclination_Click() 'They pushed the calculate button' 'Note, the following values would normally be generated by some program steps 'and checked to be sure they were numeric etc. dlat = 37.1668611 dlong = -93.35138889 alt = 350 mo = 11 da = 2 yr = 2004 txtResult.Text = MagD(dlat, dlong, alt, mo, da, yr) 'The result is displayed in a text box txtResult End Sub '_______________________________________________________________
More examples and definintions are included in geo.bas and geoTest.bas.
Contrary to popular belief, the Earth is not round. It, like most people, is a bit bigger around the girth. That girth is called the equator. The equator is one of the two axis of the Earth. The other axis is the polar axis.
Ellipsoids contain several defining values:
is represented by
Flattening is usually a small number (i.e. 0.0033900753) and is often expressed as a fraction (i.e.
). Inverse Flattening
is, of course, the denominator of the fraction.
is represented by
is represented by
Ellipsoid Parameters
The Geo Library contains definitions of the following ellipsoids:
Ellipsoid Name, ID, Major Axis, Inverse Flattening
---------------------------------------------------------------------------
Airy 1830, AA, 6377563.396, 299.3249646
Australian National, AN, 6378160 , 298.25
Bessel 1841, BR, 6377397.155, 299.1528128
Bessel 1841 (Namibia), BN, 6377483.865, 299.1528128
Clarke 1866, CC, 6378206.4 , 294.9786982
Clarke 1880, CD, 6378249.145, 293.465
Everest (Brunei, E. Malaysia ), EB, 6377298.556, 300.8017
Everest 1830, EA, 6377276.345, 300.8017
Everest 1956 (India and Nepal), EC, 6377301.243, 300.8017
Everest (Pakistan), EF, 6377309.613, 300.8017
Everest 1948 (W. Malaysia and Singapore), EE, 6377304.063, 300.8017
Everest 1969 (W. Malaysia), ED, 6377295.664, 300.8017
Geodetic Reference System 1980, RF, 6378137 , 298.257222101
Helmert 1906, HE, 6378200 , 298.3
Hough 1960, HO, 6378270 , 297.0
Indonesian 1974, ID, 6378160 , 298.247
International 1924, IN, 6378388 , 297.0
Krassovsky 1940, KA, 6378245 , 298.3
Modified Airy, AM, 6377340.189, 299.3249646
Modified Fischer 1960, FA, 6378155 , 298.3
South American 1969, SA, 6378160 , 298.25
WGS 1972, WD, 6378135 , 298.26
WGS 1984, WE, 6378137 , 298.257223563
), Longitude (
), Height (
) This coordinate system references a point on the Earth's ellipsoid. Latitude and longitude are measured in degrees. Height is measured in meters.
Latitude, Longitude, and height
Earth Fixed Geodetic Coordinates
), Azimuth (
), Elevation (
) This polar coordinate system originates from a point on the Earth's ellipsoid. Range (
) is measured in meters and represents the slant range from the origin to the point. Azimuth (
) is measured clockwise from north (zero degrees) in degrees.
is measured from the tangential plane upward. Also in degrees.
Range, Azimuth, and Elevation Coordinates
X,Y,Z Cartesian Coordinates
, Azimuth
, and Elevation
to X,Y,Z If the slant range
, azimuth
, and elevation
from the origin to a point are known, topocentric Cartesian coordinates can be computed in the following manner:
Conversion of Range, Azimuth, and Elevation to E,F,G Geocentric Coordinates
, Azimuth
, and Elevation
If Cartesian coordinates X,Y,Z are known, then slant range
, azimuth
, and elevation
can be determined this way:
, Longitude
, Height
to E,F,G Geodetic coordinates, Latitude, longitude, and height can be converted to geocentric coordinates through this method:
, Longitude
, Height
Geocentric coordinates E,F,G can be converted to latitude
, longitude
, and height
in the following manner:
By using the geomagnetic routines in this library, true north can be determined quite easily.
1.4.1