Implement more methods
This commit is contained in:
@@ -22,7 +22,6 @@ namespace LinearAlgebra {
|
||||
if (index == 1) return y;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Vector2::IsWithinMarginOfError(const Vector2& rhs, float margin) const
|
||||
{
|
||||
return this->Distance(rhs) <= margin;
|
||||
@@ -247,5 +246,11 @@ namespace LinearAlgebra {
|
||||
return {this->x*v.x, this->y*v.y};
|
||||
}
|
||||
|
||||
bool Vector2::IsFinite() const {
|
||||
return std::isfinite(x) && std::isfinite(y);
|
||||
}
|
||||
|
||||
Vector2 Vector2::Div(const Vector2 &v) const {
|
||||
return {this->x/v.x, this->y/v.y};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user