lullaby/tests/math_util_test.cc
// This test checks that the result doesn't depend on the lengths of v1 and v2.
This test checks that the result doesn't depend on the lengths of v1 and v2.
This test checks that the result doesn ' t depend on the lengths of v1 and v2 .
TEST(GetSignedAngle, LengthInvariance) {
  const mathfu::vec3 v1{1, 0, 0};
  const mathfu::vec3 v2{-1, 1, 0};
  const mathfu::vec3 axis{0, 0, 1};
  const float test_value = 3 * lull::kPi / 4;
  EXPECT_NEAR(GetSignedAngle(1.f * v1, 3.f * v2, axis), test_value, kEpsilon);
  EXPECT_NEAR(GetSignedAngle(4.f * v1, 1.f * v2, axis), test_value, kEpsilon);
  EXPECT_NEAR(GetSignedAngle(2.f * v1, 5.f * v2, axis), test_value, kEpsilon);
}
TEST ( GetSignedAngle , LengthInvariance ) { const mathfu :: vec3 v1 { 1 , 0 , 0 } ; const mathfu :: vec3 v2 { -1 , 1 , 0 } ; const mathfu :: vec3 axis { 0 , 0 , 1 } ; const float test_value = 3 * lull :: kPi / 4 ; EXPECT_NEAR ( GetSignedAngle ( 1.f * v1 , 3.f * v2 , axis ) , test_value , kEpsilon ) ; EXPECT_NEAR ( GetSignedAngle ( 4.f * v1 , 1.f * v2 , axis ) , test_value , kEpsilon ) ; EXPECT_NEAR ( GetSignedAngle ( 2.f * v1 , 5.f * v2 , axis ) , test_value , kEpsilon ) ; }
This test checks that the result doesn't depend on the lengths of v1 and v2.
This test checks that the result doesn ' t depend on the lengths of v1 and v2 .