Class Overview
Estimates magnetic field at a given point on
Earth, and in particular, to compute the magnetic declination from true
north.
This uses the World Magnetic Model produced by the United States National
Geospatial-Intelligence Agency. More details about the model can be found at
http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml.
This class currently uses WMM-2010 which is valid until 2015, but should
produce acceptable results for several years after that. Future versions of
Android may use a newer version of the model.
Summary
Public Constructors |
|
GeomagneticField(float gdLatitudeDeg, float gdLongitudeDeg, float altitudeMeters, long timeMillis)
Estimate the magnetic field at a given point and time.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Public Constructors
public
GeomagneticField
(float gdLatitudeDeg, float gdLongitudeDeg, float altitudeMeters, long timeMillis)
Estimate the magnetic field at a given point and time.
Parameters
gdLatitudeDeg
| Latitude in WGS84 geodetic coordinates -- positive is east. |
gdLongitudeDeg
| Longitude in WGS84 geodetic coordinates -- positive is north. |
altitudeMeters
| Altitude in WGS84 geodetic coordinates, in meters. |
timeMillis
| Time at which to evaluate the declination, in milliseconds
since January 1, 1970. (approximate is fine -- the declination
changes very slowly).
|
Public Methods
public
float
getDeclination
()
Returns
- The declination of the horizontal component of the magnetic
field from true north, in degrees (i.e. positive means the
magnetic field is rotated east that much from true north).
public
float
getFieldStrength
()
Returns
- Total field strength in nanoteslas.
public
float
getHorizontalStrength
()
Returns
- Horizontal component of the field strength in nonoteslas.
public
float
getInclination
()
Returns
- The inclination of the magnetic field in degrees -- positive
means the magnetic field is rotated downwards.
public
float
getX
()
Returns
- The X (northward) component of the magnetic field in nanoteslas.
public
float
getY
()
Returns
- The Y (eastward) component of the magnetic field in nanoteslas.
public
float
getZ
()
Returns
- The Z (downward) component of the magnetic field in nanoteslas.