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

29 lines
612 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.
# Vector2::Normalized
```cpp
Vector2 Normalized() const
```
返回当前向量的归一化副本(单位长度)。不修改原向量。如果向量长度接近零(小于 EPSILON返回零向量。
**返回:** `Vector2` - 归一化后的向量副本
**线程安全:**
**异常:** (无)
**复杂度:** O(1)
**示例:**
```cpp
Vector2 v(3.0f, 4.0f);
Vector2 unit = v.Normalized(); // (0.6f, 0.8f), v 保持不变
```
## 相关文档
- [Vector2](vector2.md) - 返回类总览
- [Normalize](normalize.md) - 静态方法归一化
- [Magnitude](magnitude.md) - 计算向量长度