public final class MagnetometerReading
extends java.lang.Object
MagnetometerService.
By using a device's geomagnetic field sensor in combination with the device's accelerometer,
three orientation angles (azimut, pitch and roll) can be determinedMagnetometerService| Constructor | Description |
|---|---|
MagnetometerReading(double x,
double y,
double z,
double magnitude,
double yaw,
double pitch,
double roll) |
Creates a new immutable Reading instance with the given x, y, z, magnitude values, and orientation angles.
|
| Modifier and Type | Method | Description |
|---|---|---|
double |
getAzimuth() |
Azimuth (rotation about the -z axis, degrees).
|
double |
getMagnitude() |
Returns the magnitude of the reading, microtesla units
|
double |
getPitch() |
Pitch (rotation about the x axis, radians).
|
double |
getRoll() |
Roll (rotation about the y axis, radians).
|
double |
getX() |
Returns the x value of the reading, microtesla units.
|
double |
getY() |
Returns the y value of the reading, microtesla units
|
double |
getYaw() |
Yaw (rotation about the -z axis, radians).
|
double |
getZ() |
Returns the z value of the reading, microtesla units
|
public MagnetometerReading(double x,
double y,
double z,
double magnitude,
double yaw,
double pitch,
double roll)
x - The x value of the readingy - The y value of the readingz - The z value of the readingmagnitude - The magnitude of the readingyaw - rotation about the -z axispitch - rotation about the x axisroll - rotation about the y axispublic double getX()
public double getY()
public double getZ()
public double getMagnitude()
public double getYaw()
public double getPitch()
public double getRoll()
public double getAzimuth()