AP_Math: added test for vector2f rotate

This commit is contained in:
Andrew Tridgell 2020-07-06 13:18:06 +10:00 committed by Peter Barker
parent 259cf10373
commit b6a5509409

View File

@ -52,6 +52,12 @@ TEST(Vector2Test, reflect)
Vector2f reflected3 = Vector2f(3, 3);
reflected3.reflect(Vector2f(1, -1));
EXPECT_EQ(reflected3, Vector2f(-3, -3));
// rotation
Vector2f base = Vector2f(2, 1);
base.rotate(radians(90));
EXPECT_FLOAT_EQ(base.x, -1);
EXPECT_FLOAT_EQ(base.y, 2);
}
TEST(Vector2Test, closest_point)