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

@@ -0,0 +1,28 @@
# Vector4::operator[]
```cpp
float operator[](int index) const
float& operator[](int index)
```
通过下标访问向量分量。
**参数:**
- `index` - 分量索引 (0=x, 1=y, 2=z, 3=w)
**返回:** `float``float&` - 对应分量的值(常量版本返回值,左值版本返回引用)
**注意事项:** 未进行边界检查。index 应在 [0, 3] 范围内。
**示例:**
```cpp
Vector4 v(1.0f, 2.0f, 3.0f, 4.0f);
float x = v[0]; // 1.0f
float w = v[3]; // 4.0f
v[1] = 5.0f; // v 变为 (1, 5, 3, 4)
```
## 相关文档
- [Vector4 总览](vector4.md) - 返回类总览