Implement static operator*

This commit is contained in:
2024-02-01 20:22:32 -05:00
parent 432fa32f57
commit 12bf687f33
3 changed files with 11 additions and 9 deletions

View File

@@ -7,6 +7,8 @@ namespace LinearAlgebra {
using namespace J3ML;
/// A 2D (x, y) ordered pair.
class Vector2 {
public:
@@ -121,6 +123,10 @@ namespace LinearAlgebra {
/// Multiplies this vector by a vector, element-wise
/// @note Mathematically, the multiplication of two vectors is not defined in linear space structures,
/// but this function is provided here for syntactical convenience.
Vector2 operator *(const Vector2& rhs) const
{
}
Vector2 Mul(const Vector2& v) const;
/// Divides this vector by a scalar.
@@ -147,4 +153,9 @@ namespace LinearAlgebra {
float y = 0;
};
static Vector2 operator*(float lhs, const Vector2 &rhs)
{
return rhs * lhs;
}
}