SensorManager.GetRotationMatrix(Single[], Single[], Single[], Single[]) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Computes the inclination matrix <b>I</b> as well as the rotation matrix <b>R</b> transforming a vector from the device coordinate system to the world's coordinate system which is defined as a direct orthonormal basis, where:
[Android.Runtime.Register("getRotationMatrix", "([F[F[F[F)Z", "")]
public static bool GetRotationMatrix (float[]? R, float[]? I, float[]? gravity, float[]? geomagnetic);
[<Android.Runtime.Register("getRotationMatrix", "([F[F[F[F)Z", "")>]
static member GetRotationMatrix : single[] * single[] * single[] * single[] -> bool
Parameters
- R
- Single[]
is an array of 9 floats holding the rotation matrix <b>R</b> when this function returns. R can be null. <p>
- I
- Single[]
is an array of 9 floats holding the rotation matrix <b>I</b> when this function returns. I can be null. <p>
- gravity
- Single[]
is an array of 3 floats containing the gravity vector expressed in
the device's coordinate. You can simply use the
android.hardware.SensorEvent#values values returned by a
android.hardware.SensorEvent SensorEvent of a
android.hardware.Sensor Sensor of type
android.hardware.Sensor#TYPE_ACCELEROMETER
TYPE_ACCELEROMETER.
<p>
- geomagnetic
- Single[]
is an array of 3 floats containing the geomagnetic vector
expressed in the device's coordinate. You can simply use the
android.hardware.SensorEvent#values values returned by a
android.hardware.SensorEvent SensorEvent of a
android.hardware.Sensor Sensor of type
android.hardware.Sensor#TYPE_MAGNETIC_FIELD
TYPE_MAGNETIC_FIELD.
Returns
<code>true</code> on success, <code>false</code> on failure (for instance, if the device is in free fall). Free fall is defined as condition when the magnitude of the gravity is less than 1/10 of the nominal value. On failure the output matrices are not modified.
- Attributes
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
See also
- GetInclination(Single[])
- <xref:Android.Hardware.SensorManager.GetOrientation(System.Single%5b%5d%2c+System.Single%5b%5d)>
- <xref:Android.Hardware.SensorManager.RemapCoordinateSystem(System.Single%5b%5d%2c+Android.Hardware.Axis%2c+Android.Hardware.Axis%2c+Android.Hardware.Axis)>