public class GeomagneticField extends Object
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.
Constructor and Description |
---|
GeomagneticField(float gdLatitudeDeg,
float gdLongitudeDeg,
float altitudeMeters,
long timeMillis)
Estimate the magnetic field at a given point and time.
|
Modifier and Type | Method and Description |
---|---|
float |
getDeclination() |
float |
getFieldStrength() |
float |
getHorizontalStrength() |
float |
getInclination() |
float |
getX() |
float |
getY() |
float |
getZ() |
public GeomagneticField(float gdLatitudeDeg, float gdLongitudeDeg, float altitudeMeters, long timeMillis)
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 float getX()
public float getY()
public float getZ()
public float getDeclination()
public float getInclination()
public float getHorizontalStrength()
public float getFieldStrength()