feat: added exact equality check to equals approximate

main
Sara 2024-11-15 16:41:37 +01:00
parent c26f3512c2
commit ceda802936
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ float Vecf::distance(Vecf const &from, Vecf const &to) {
}
bool Vecf::equals_approximate(Vecf const &lhs, Vecf const &rhs) {
return std::fabs(lhs.x - rhs.x) < VECTOR_EPSILON && std::fabs(lhs.y - rhs.y) < VECTOR_EPSILON;
return lhs == rhs || (std::fabs(lhs.x - rhs.x) < VECTOR_EPSILON && std::fabs(lhs.y - rhs.y) < VECTOR_EPSILON);
}
float Vecf::dot(Vecf const &lhs, Vecf const &rhs) {