Files
XCEngine/docs/api/math/matrix3/inverse.md

24 lines
499 B
Markdown
Raw Normal View History

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