Version: 2020.1
public float determinant ;




using UnityEngine;

public class ExampleScript : MonoBehaviour { void Update() { // create a transformation matrix with scale, zero position and no rotation var scale = new Vector3(5,3,2); var matrix = Matrix4x4.TRS(, Quaternion.identity, scale);

// determinant of a scaled matrix is volume of the parallelepiped // formed from its axes, in this case 5*3*2=30 Debug.Log(matrix.determinant); } }

请参阅 Wikipedia 上的行列式以了解更多详细信息。

另请参阅:inverse 属性、Inverse3DAffine 方法。