Files
XCEngine/docs/api/math/matrix3/inverse.md
2026-03-20 02:35:15 +08:00

499 B
Raw Blame History

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 应接近单位矩阵