mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
* rename TranformationKnowledge to TransformTraits
* apply the same principle to extractRotation and fix it to extract a rotation corresponding to a positive scaling
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "main.h"
|
||||
#include <Eigen/Geometry>
|
||||
#include <Eigen/LU>
|
||||
#include <Eigen/QR>
|
||||
|
||||
template<typename Scalar> void geometry(void)
|
||||
{
|
||||
@@ -231,12 +232,18 @@ template<typename Scalar> void geometry(void)
|
||||
t0.setIdentity();
|
||||
t0.translate(v0).rotate(q1);
|
||||
VERIFY_IS_APPROX(t0.inverse(NoScaling), t0.matrix().inverse());
|
||||
|
||||
// test extract rotation
|
||||
t0.setIdentity();
|
||||
t0.translate(v0).rotate(q1).scale(v1);
|
||||
VERIFY_IS_APPROX(t0.extractRotation(GenericAffine) * v1, Matrix3(q1) * v1);
|
||||
VERIFY_IS_APPROX(t0.extractRotation(NoShear) * v1, Matrix3(q1) * v1);
|
||||
}
|
||||
|
||||
void test_geometry()
|
||||
{
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
CALL_SUBTEST( geometry<float>() );
|
||||
CALL_SUBTEST( geometry<double>() );
|
||||
// CALL_SUBTEST( geometry<double>() );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user