Files
XCEngine/docs/api/math/vector2/operator-mul.md

30 lines
488 B
Markdown
Raw Normal View History

# Vector2::operator*
```cpp
Vector2 operator*(float scalar) const
```
向量数乘,将向量与标量相乘。
**参数:**
- `scalar` - 标量值
**返回:** `Vector2` - 缩放后的向量
**线程安全:** ✅
**复杂度:** O(1)
**示例:**
```cpp
Vector2 v(2.0f, 3.0f);
Vector2 scaled = v * 2.0f; // (4.0f, 6.0f)
```
## 相关文档
- [Vector2 总览](vector2.md)
- [`operator/`](operator-div.md) - 除法
- [`operator*=`](operator-mul-assign.md) - 乘法赋值