com.AndrewGray.geoutils
Class GeoMagVar

java.lang.Object
  |
  +--com.AndrewGray.geoutils.GeoMagVar

public class GeoMagVar
extends java.lang.Object

Class calculates the geomagnetic variation at a given LatLong using the IGRF2000 model. This yields the offset a magnetic compass will show from true north at a given location.


Constructor Summary
GeoMagVar()
          create a new GeoMagVar calculator.
 
Method Summary
 double calculateMagneticVariation(LatLong latLong)
          Return the predicted geomagnetic variation (in radians) at the given LatLong using the current settings for height and date.
 void setDate(java.util.Calendar cal)
          set the date for which subsequent geo-variance calculations are performed
 void setHeight(double h)
          set the date for which subsequent geo-variance calculations are performed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoMagVar

public GeoMagVar()
create a new GeoMagVar calculator. Date is set to the current date and time, height to the earth's surface
Method Detail

setDate

public void setDate(java.util.Calendar cal)
set the date for which subsequent geo-variance calculations are performed
Parameters:
cal - the calendar representing the required date

setHeight

public void setHeight(double h)
set the date for which subsequent geo-variance calculations are performed
Parameters:
h - the height in meters

calculateMagneticVariation

public double calculateMagneticVariation(LatLong latLong)
Return the predicted geomagnetic variation (in radians) at the given LatLong using the current settings for height and date. The returned offset should be subtracted from a geographic (true north) bearing to yield the predicted reading on a magnetic compass.
Parameters:
latLong - the Latitude & Longitude for which geomagnetic variation is to be computed.
Returns:
the geomagnetic variation in radians.