Implement static operator*
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user