Skip to content

Commit

Permalink
(tests): adds test for euler->quat conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
wpumacay committed Jun 19, 2024
1 parent b369412 commit d0a2940
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/cpp/test_quat_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,26 @@ TEMPLATE_TEST_CASE("Quaternion class (quat_t) constructors",
REQUIRE(::math::func_all_close<T>(q, cos_half, 0.0, 0.0, sin_half,
EPSILON));
}

// e = (30°, 45°, 60°, XYZ, INTRINSIC)
{
Euler e(::math::PI / 6, ::math::PI / 4, ::math::PI / 3,
::math::euler::Order::XYZ);
Quat q(e);

REQUIRE(::math::func_all_close<T>(q, 0.7233174, 0.3919038,
0.2005621, 0.5319757, EPSILON));
}

// e = (30°, 45°, 60°, YXZ, INTRINSIC)
{
Euler e(::math::PI / 6, ::math::PI / 4, ::math::PI / 3,
::math::euler::Order::YXZ);
Quat q(e);

REQUIRE(::math::func_all_close<T>(q, 0.8223632, 0.3919038,
0.2005621, 0.3604234, EPSILON));
}
}
}

Expand Down

0 comments on commit d0a2940

Please sign in to comment.