Android.Hardware.SensorManager.GetOrientation Method
Computes the device's orientation based on the rotation matrix.

Syntax

[Android.Runtime.Register("getOrientation", "([F[F)[F", "")]
public static float[] GetOrientation (float[] R, float[] values)

See Also

SensorManager.GetRotationMatrix(Single[], System.Single[], System.Single[], System.Single[])
GeomagneticField

Parameters

R
rotation matrix see SensorManager.GetRotationMatrix(Single[], System.Single[], System.Single[], System.Single[]).
values
an array of 3 floats to hold the result.

Returns

Documentation for this section has not yet been entered.

Remarks

Computes the device's orientation based on the rotation matrix.

When it returns, the array values is filled with the result:

  • values[0]: azimuth, rotation around the Z axis.
  • values[1]: pitch, rotation around the X axis.
  • values[2]: roll, rotation around the Y axis.

The reference coordinate-system used is different from the world coordinate-system defined for the rotation matrix:

  • X is defined as the vector product Y.Z (It is tangential to the ground at the device's current location and roughly points West).
  • Y is tangential to the ground at the device's current location and points towards the magnetic North Pole.
  • Z points towards the center of the Earth and is perpendicular to the ground.

All three angles above are in radians and positive in the counter-clockwise direction.

[Android Documentation]

Requirements

Namespace: Android.Hardware
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 3