Skip to content

Commit

Permalink
Add test for converting between Degrees and Radians
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mott committed Mar 21, 2021
1 parent c0fd3da commit 5c81357
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/math/Matrix4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ TEST(MathTest, MatrixEquality)
EXPECT_TRUE(m2 != Matrix4::getIdentity());
}

TEST(MathTest, ConvertDegreesAndRadians)
{
math::Degrees thirtyD(30);
EXPECT_DOUBLE_EQ(thirtyD.asDegrees(), 30);
EXPECT_DOUBLE_EQ(thirtyD.asRadians(), math::PI / 6.0);

math::Radians twoPiBy3R(2 * math::PI / 3.0);
EXPECT_DOUBLE_EQ(twoPiBy3R.asDegrees(), 120);
EXPECT_DOUBLE_EQ(twoPiBy3R.asRadians(), 2 * math::PI / 3.0);
}

TEST(MathTest, MatrixRotationAboutXDegrees)
{
double angle = 30.0;
Expand Down

0 comments on commit 5c81357

Please sign in to comment.