Add Vector2::PreciselyEquals(),
This commit is contained in:
@@ -513,6 +513,20 @@ namespace J3ML::LinearAlgebra {
|
|||||||
y = rhs.y;
|
y = rhs.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Vector2::Equals(const Vector2 &rhs, float epsilon) const {
|
||||||
|
return Math::EqualAbs(x, rhs.x, epsilon) &&
|
||||||
|
Math::EqualAbs(y, rhs.y, epsilon);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Vector2::Equals(float x_, float y_, float epsilon) const {
|
||||||
|
return Math::EqualAbs(x, x_, epsilon) &&
|
||||||
|
Math::EqualAbs(y, y_, epsilon);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Vector2::PreciselyEquals(const Vector2 &rhs) const {
|
||||||
|
return this->x == rhs.x && this->y == rhs.y;
|
||||||
|
}
|
||||||
|
|
||||||
Vector2 operator*(float lhs, const Vector2 &rhs) {
|
Vector2 operator*(float lhs, const Vector2 &rhs) {
|
||||||
return {lhs * rhs.x, lhs * rhs.y};
|
return {lhs * rhs.x, lhs * rhs.y};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user