Start quaternions.

This commit is contained in:
2019-08-05 00:12:03 -07:00
parent 3a5dd0490c
commit 4cf4693088
4 changed files with 143 additions and 12 deletions

23
test/quaternion_test.cc Normal file
View File

@@ -0,0 +1,23 @@
#include <gtest/gtest.h>
#include <wrmath/geom/quaternion.h>
using namespace std;
using namespace wr;
TEST(Quaterniond, Addition)
{
geom::Quaterniond p(geom::Vector3d {1.0, -2.0, 1.0}, 3.0);
geom::Quaterniond q(geom::Vector3d {-1.0, 2.0, 3.0}, 2.0);
geom::Quaterniond expected(geom::Vector3d{-9.0, -2.0, 11.0}, 8.0);
EXPECT_EQ(p * q, expected);
}
int
main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}