語言

SensorManager.GetRotationMatrixFromVector(Single[], Single[]) 方法

定義

輔助函數,將旋轉向量轉換成旋轉矩陣。

[Android.Runtime.Register("getRotationMatrixFromVector", "([F[F)V", "")]
public static void GetRotationMatrixFromVector(float[]? R, float[]? rotationVector);
[<Android.Runtime.Register("getRotationMatrixFromVector", "([F[F)V", "")>]
static member GetRotationMatrixFromVector : single[] * single[] -> unit

參數

R
Single[]

一個用來儲存旋轉矩陣的浮點陣列

rotationVector
Single[]

旋轉向量 以轉換

屬性

備註

輔助函數,將旋轉向量轉換成旋轉矩陣。 給定旋轉向量(推測來自ROTATION_VECTOR感測器),回傳陣列 R 中一個 9 或 16 元素的旋轉矩陣。R 必須長度為 9 或 16。 若 R.length =9,則回傳以下矩陣:

/  R[ 0]   R[ 1]   R[ 2]   \
              |  R[ 3]   R[ 4]   R[ 5]   |
              \  R[ 6]   R[ 7]   R[ 8]   /

若 R.length ==16,則回傳以下矩陣:

/  R[ 0]   R[ 1]   R[ 2]   0  \
              |  R[ 4]   R[ 5]   R[ 6]   0  |
              |  R[ 8]   R[ 9]   R[10]   0  |
              \  0       0       0       1  /

Java 文件 android.hardware.SensorManager.getRotationMatrixFromVector(float[], float[])。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於