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,35 @@
# Vector3::operator[]
```cpp
float operator[](int index) const
float& operator[](int index)
```
通过索引访问向量的分量。0 = x, 1 = y, 2 = z。
**参数:**
- `index` - 分量索引0、1 或 2
**返回:** `float``float&` - 对应分量的值const 版本返回值non-const 版本返回引用)
**异常:** 如果 index 超出范围(< 0 或 > 2行为未定义
**线程安全:**
**复杂度:** O(1)
**示例:**
```cpp
Vector3 v(1.0f, 2.0f, 3.0f);
float x = v[0]; // 1.0f
float y = v[1]; // 2.0f
float z = v[2]; // 3.0f
v[0] = 10.0f; // v = (10.0f, 2.0f, 3.0f)
```
## 相关文档
- [Vector3 类总览](vector3.md) - 返回类总览