499 B
499 B
Matrix3::Inverse
Matrix3 Inverse() const
返回矩阵的逆矩阵。
返回: Matrix3 - 逆矩阵。如果行列式接近零(< EPSILON),则返回单位矩阵。
异常: 当矩阵奇异(行列式为零)时,返回单位矩阵而非抛出异常。
复杂度: O(1)
示例:
Matrix3 mat = Matrix3::RotationY(0.5f);
Matrix3 inv = mat.Inverse();
// 验证:M * M⁻¹ ≈ I
Matrix3 identity = mat * inv;
// identity 应接近单位矩阵