Also fixed unary RectangularMatrix::operator-() and Vector::operator-()
documentation (was stating that the operation is done in-place, which is
impossible.
Having implicit conversion on Unit class causes much more harm than
doing the conversion some other way -- mainly for multiplication and
division, which is done with builtin operators and thus the result is
unitless. Also it is possible to do wrong "retyping" between degrees and
radians:
Rad a = Constants::pi();
Deg b(a*2);
On GCC >4.5 b is `180`, but on GCC 4.4 it is `2pi`, which is obviously
wrong and not wanted.
The conversion is done using Unit::toUnderlyingType() which is now used
everywhere instead of conversion operator. The conversion operator is
made available only for GCC 4.5, where it can be marked as explicit.
This might cause incompatibilites with `master` branch, where no
Unit::toUnderlyingType() exists, but users should have no need to
convert it to underlying type anyway as all required functions are
available through the library.
This reverts commit 36ac4de5c4 and
partially also 0db3a183ae (UnitTest.cpp).
Comparing squared length to 1 is not sufficient to compare within range
[1 - epsilon, 1 + epsilon], as e.g. Quaternion with dot() = 1 + 1e-7
when converted to matrix has column vectors with dot() = 1 + 1e-6, which
is just above 1 + epsilon. Thus it's needed to compare sqrt(dot()) in
range [1 - epsilon, 1 + epsilon] or dot() in range [1 - 2*epsilon +
epsilon^2, 1 + 2*epsilon + epsilon^2]. Because epsilon^2 is way off
machine precision, it's omitted, thus dot() in all isNormalized()
implementations is now compared this way:
abs(dot() - 1) < 2*epsilon;
DualQuaternion and DualComplex has now only rotation() which returns
full rotation part, rotationAngle() and rotationAxis() on Quaternion and
Complex were renamed to angle() and axis().
As there is no Magnum::TypeTraits struct anymore, there is no need to
have redundant name in it. Hopefully Doxygen will handle the difference
between this and Corrade's TypeTraits.h properly.
It better visualizes the fact that neither (Dual)Complex nor
(Dual)Quaternion contains the matrix inside them, but performs (possibly
costly) conversion.
Square matrices already had that, (dual) quaternions too, making that
the default also with complex numbers. Updated the documentation to
reflect that.