public static class CategoryEnvironmentData.GeomagneticField extends Object
This class uses World Magnetic Model (WMM) 2020, which is produced by the United States' National Geospatial-Intelligence Agency (NGA) and valid until 2025.
SystemCapability.Sensors#SENSOR| 构造器 | 说明 |
|---|---|
GeomagneticField(float latitude,
float longitude,
float altitude,
long timeMillis) |
A constructor used to create a
GeomagneticField object based on the specified location and time. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
float |
obtainDeflectionAngle() |
Obtains the magnetic declination, which is the angle on the horizontal plane between magnetic
north and true north.
|
float |
obtainGeomagneticDip() |
Obtains the magnetic dip, which is the angle made with the horizontal by the Earth's magnetic field lines.
|
float |
obtainLevelIntensity() |
Obtains the horizontal intensity of the geomagnetic field.
|
float |
obtainTotalIntensity() |
Obtains the total intensity of the geomagnetic field.
|
float |
obtainX() |
Obtains the north component X of the geomagnetic field.
|
float |
obtainY() |
Obtains the east component Y of the geomagnetic field.
|
float |
obtainZ() |
Obtains the vertical component Z of the geomagnetic field.
|
public GeomagneticField(float latitude,
float longitude,
float altitude,
long timeMillis)
GeomagneticField object based on the specified location and time.latitude - Indicates the latitude in the World Geodetic System 1984 (WGS84). The value is
positive eastwards.longitude - Indicates the longitude in WGS84. The value is positive northward.altitude - Indicates the altitude in WGS84. The value is positive downward, in meters.timeMillis - Indicates the time at which the magnetic declination is to be obtained, in milliseconds
since the Unix epoch.public float obtainX()
public float obtainY()
public float obtainZ()
public float obtainGeomagneticDip()
public float obtainDeflectionAngle()
public float obtainLevelIntensity()
public float obtainTotalIntensity()