| 73 | } |
| 74 | |
| 75 | bool Vector2::is_normalized() const { |
| 76 | // use length_squared() instead of length() to avoid sqrt(), makes it more stringent. |
| 77 | return Math::is_equal_approx(length_squared(), 1, (real_t)UNIT_EPSILON); |
| 78 | } |
| 79 | |
| 80 | real_t Vector2::distance_to(const Vector2 &p_vector2) const { |
| 81 | return Math::sqrt((x - p_vector2.x) * (x - p_vector2.x) + (y - p_vector2.y) * (y - p_vector2.y)); |
no test coverage detected