docs: update math API docs

This commit is contained in:
2026-03-20 02:35:15 +08:00
parent e165dbea1c
commit c5b17239ca
243 changed files with 5307 additions and 1327 deletions

View File

@@ -1,18 +1,39 @@
# Matrix4::Inverse
# Matrix4x4::Inverse
```cpp
Matrix4 Inverse() const
Matrix4x4 Inverse() const
```
返回矩阵的逆矩阵。
返回矩阵的逆矩阵。如果矩阵的行列式接近零(不可逆),则返回单位矩阵。
**返回** `Matrix4` - 逆矩阵
**参数** (无)
**复杂度** O(1)
**返回** 逆矩阵;如果矩阵不可逆则返回单位矩阵
**线程安全:**
**复杂度:** O(n³),对于 4x4 矩阵固定为 64 次基本运算
**示例:**
```cpp
Matrix4 m = ...;
Matrix4 inv = m.Inverse();
#include "XCEngine/Math/Matrix4.h"
using namespace XCEngine::Math;
Matrix4 transform = Matrix4::TRS(
Vector3(1.0f, 2.0f, 3.0f),
Quaternion::FromEuler(0.0f, 45.0f, 0.0f),
Vector3(2.0f, 2.0f, 2.0f)
);
Matrix4 inv = transform.Inverse();
Matrix4 identity = transform * inv;
// identity 接近单位矩阵
```
## 相关文档
- [Matrix4](matrix4.md) - 返回类总览
- [Determinant](determinant.md) - 计算行列式
- [Transpose](transpose.md) - 矩阵转置