Implement more methods

This commit is contained in:
2024-01-30 21:35:55 -05:00
parent 0c20e9bb21
commit 132b8a0a66
7 changed files with 55 additions and 15 deletions

View File

@@ -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};
}
}