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

30 lines
521 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Vector3::Angle
```cpp
static float Angle(const Vector3& from, const Vector3& to)
```
计算两个向量之间的夹角(以度为单位)。
**参数:**
- `from` - 起始向量
- `to` - 目标向量
**返回:** `float` - 两向量之间的夹角0-180度
**线程安全:**
**复杂度:** O(1)
**示例:**
```cpp
Vector3 a(1.0f, 0.0f, 0.0f);
Vector3 b(0.0f, 1.0f, 0.0f);
float angle = Vector3::Angle(a, b); // 90.0f
```
## 相关文档
- [Vector3 类总览](vector3.md) - 返回类总览