Most visited

Recently visited

Added in API level 3

GeomagneticField

public class GeomagneticField
extends Object

java.lang.Object
   ↳ android.hardware.GeomagneticField


估计地球上给定点的磁场,特别是从真北方计算磁偏角。

这使用由美国国家地理空间情报局制作的世界磁性模型。 有关该模型的更多细节可在http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml找到。 此课程目前使用的WMM-2010在2015年之前有效,但在此之后的几年内应该会产生可接受的结果。 未来的Android版本可能会使用更新版本的模型。

Summary

Public constructors

GeomagneticField(float gdLatitudeDeg, float gdLongitudeDeg, float altitudeMeters, long timeMillis)

估计给定点和时间的磁场。

Public methods

float getDeclination()
float getFieldStrength()
float getHorizontalStrength()
float getInclination()
float getX()
float getY()
float getZ()

Inherited methods

From class java.lang.Object

Public constructors

GeomagneticField

Added in API level 3
GeomagneticField (float gdLatitudeDeg, 
                float gdLongitudeDeg, 
                float altitudeMeters, 
                long timeMillis)

估计给定点和时间的磁场。

Parameters
gdLatitudeDeg float: Latitude in WGS84 geodetic coordinates -- positive is east.
gdLongitudeDeg float: Longitude in WGS84 geodetic coordinates -- positive is north.
altitudeMeters float: Altitude in WGS84 geodetic coordinates, in meters.
timeMillis long: Time at which to evaluate the declination, in milliseconds since January 1, 1970. (approximate is fine -- the declination changes very slowly).

Public methods

getDeclination

Added in API level 3
float getDeclination ()

Returns
float 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).

getFieldStrength

Added in API level 3
float getFieldStrength ()

Returns
float Total field strength in nanoteslas.

getHorizontalStrength

Added in API level 3
float getHorizontalStrength ()

Returns
float Horizontal component of the field strength in nonoteslas.

getInclination

Added in API level 3
float getInclination ()

Returns
float The inclination of the magnetic field in degrees -- positive means the magnetic field is rotated downwards.

getX

Added in API level 3
float getX ()

Returns
float The X (northward) component of the magnetic field in nanoteslas.

getY

Added in API level 3
float getY ()

Returns
float The Y (eastward) component of the magnetic field in nanoteslas.

getZ

Added in API level 3
float getZ ()

Returns
float The Z (downward) component of the magnetic field in nanoteslas.

Hooray!