Add some notes to the SLERP test.

This commit is contained in:
Kyle Isom 2019-08-06 00:59:25 -07:00
parent be0d5f9b71
commit b7c42a5fc5
1 changed files with 7 additions and 2 deletions

View File

@ -109,10 +109,15 @@ TEST(Quaterniond, Rotate)
TEST(Quaterniond, ShortestSLERP)
{
// Our starting point is an orientation that is yawed 45° - our
// orientation is pointed π/4 radians in the X axis.
geom::Quaterniond p = geom::Quaterniond {0.382683, 0, 0, 0.92388};
// Our ending point is an orientation that is yawed -45° - or
// pointed -π/4 radians in the X axis.
geom::Quaterniond q = geom::Quaterniond {-0.382683, 0, 0, 0.92388};
geom::Quaterniond r = geom::Quaterniond {0, 0, 0, 1};
// The halfway point should be oriented midway about the X axis. It turns
// out this is an identity quaternion.
geom::Quaterniond r;
EXPECT_EQ(geom::ShortestSLERP(p, q, 0.0), p);
EXPECT_EQ(geom::ShortestSLERP(p, q, 1.0), q);