lullaby/tests/math_util_test.cc
// This test verifies that GetSignedAngle operates roughly correctly.
This test verifies that GetSignedAngle operates roughly correctly.
This test verifies that GetSignedAngle operates roughly correctly .
TEST(GetSignedAngle, BasicOperation) {
  const float one_eighth = lull::kPi / 4;
  EXPECT_NEAR(
      GetSignedAngle(mathfu::kAxisX3f, mathfu::kAxisX3f, mathfu::kAxisZ3f),
      0 * one_eighth, kEpsilon);
  EXPECT_NEAR(
      GetSignedAngle(mathfu::kAxisX3f, mathfu::kAxisX3f + mathfu::kAxisY3f,
                     mathfu::kAxisZ3f),
      1 * one_eighth, kEpsilon);
  EXPECT_NEAR(
      GetSignedAngle(mathfu::kAxisX3f, mathfu::kAxisY3f, mathfu::kAxisZ3f),
      2 * one_eighth, kEpsilon);
  EXPECT_NEAR(
      GetSignedAngle(mathfu::kAxisX3f, -mathfu::kAxisX3f + mathfu::kAxisY3f,
                     mathfu::kAxisZ3f),
      3 * one_eighth, kEpsilon);
  EXPECT_NEAR(
      GetSignedAngle(mathfu::kAxisX3f, -mathfu::kAxisX3f, mathfu::kAxisZ3f),
      4 * one_eighth, kEpsilon);
  EXPECT_NEAR(
      GetSignedAngle(mathfu::kAxisX3f, -mathfu::kAxisX3f + -mathfu::kAxisY3f,
                     mathfu::kAxisZ3f),
      -3 * one_eighth, kEpsilon);
  EXPECT_NEAR(
      GetSignedAngle(mathfu::kAxisX3f, -mathfu::kAxisY3f, mathfu::kAxisZ3f),
      -2 * one_eighth, kEpsilon);
  EXPECT_NEAR(
      GetSignedAngle(mathfu::kAxisX3f, mathfu::kAxisX3f + -mathfu::kAxisY3f,
                     mathfu::kAxisZ3f),
      -1 * one_eighth, kEpsilon);
}
TEST ( GetSignedAngle , BasicOperation ) { const float one_eighth = lull :: kPi / 4 ; EXPECT_NEAR ( GetSignedAngle ( mathfu :: kAxisX3f , mathfu :: kAxisX3f , mathfu :: kAxisZ3f ) , 0 * one_eighth , kEpsilon ) ; EXPECT_NEAR ( GetSignedAngle ( mathfu :: kAxisX3f , mathfu :: kAxisX3f + mathfu :: kAxisY3f , mathfu :: kAxisZ3f ) , 1 * one_eighth , kEpsilon ) ; EXPECT_NEAR ( GetSignedAngle ( mathfu :: kAxisX3f , mathfu :: kAxisY3f , mathfu :: kAxisZ3f ) , 2 * one_eighth , kEpsilon ) ; EXPECT_NEAR ( GetSignedAngle ( mathfu :: kAxisX3f , - mathfu :: kAxisX3f + mathfu :: kAxisY3f , mathfu :: kAxisZ3f ) , 3 * one_eighth , kEpsilon ) ; EXPECT_NEAR ( GetSignedAngle ( mathfu :: kAxisX3f , - mathfu :: kAxisX3f , mathfu :: kAxisZ3f ) , 4 * one_eighth , kEpsilon ) ; EXPECT_NEAR ( GetSignedAngle ( mathfu :: kAxisX3f , - mathfu :: kAxisX3f + - mathfu :: kAxisY3f , mathfu :: kAxisZ3f ) , -3 * one_eighth , kEpsilon ) ; EXPECT_NEAR ( GetSignedAngle ( mathfu :: kAxisX3f , - mathfu :: kAxisY3f , mathfu :: kAxisZ3f ) , -2 * one_eighth , kEpsilon ) ; EXPECT_NEAR ( GetSignedAngle ( mathfu :: kAxisX3f , mathfu :: kAxisX3f + - mathfu :: kAxisY3f , mathfu :: kAxisZ3f ) , -1 * one_eighth , kEpsilon ) ; }
This test verifies that GetSignedAngle operates roughly correctly.
This test verifies that GetSignedAngle operates roughly correctly .