Browse Source

Math: test also that DualComplex transformations are normalized.

Fails for translation.
pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
5e2f8db651
  1. 2
      src/Math/Test/DualComplexTest.cpp

2
src/Math/Test/DualComplexTest.cpp

@ -160,6 +160,7 @@ void DualComplexTest::invertedNormalized() {
void DualComplexTest::rotation() {
DualComplex a = DualComplex::rotation(Deg(120.0f));
CORRADE_COMPARE(a.length(), 1.0f);
CORRADE_COMPARE(a, DualComplex({-0.5f, 0.8660254f}, {0.0f, 0.0f}));
CORRADE_COMPARE_AS(a.rotationAngle(), Deg(120.0f), Rad);
}
@ -167,6 +168,7 @@ void DualComplexTest::rotation() {
void DualComplexTest::translation() {
Vector2 vec(1.5f, -3.5f);
DualComplex a = DualComplex::translation(vec);
CORRADE_COMPARE(a.length(), 1.0f);
CORRADE_COMPARE(a, DualComplex({}, {1.5f, -3.5f}));
CORRADE_COMPARE(a.translation(), vec);
}

Loading…
Cancel
Save