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

432 B

Matrix3::operator* (Vector3)

Vector3 operator*(const Vector3& v) const

矩阵-向量乘法运算,将矩阵应用于向量。

参数:

  • v - 三维向量

返回: Vector3 - 变换后的向量

复杂度: O(1)

示例:

Matrix3 rotation = Matrix3::RotationZ(Math::Radians(90.0f));
Vector3 v(1.0f, 0.0f, 0.0f);

Vector3 rotated = rotation * v;
// 结果: approximately (0, 1, 0)