diff options
author | Essex Edwards <essexe@zivadynamics.com> | 2020-12-14 13:03:46 -0800 |
---|---|---|
committer | Antonio Sánchez <cantonios@google.com> | 2021-01-07 17:45:14 +0000 |
commit | e741b436684da485a9abd6d46686a0be143296e0 (patch) | |
tree | 7ffb80f31b69bb89126872088cb75e361e8b0ef9 /Eigen/src/Geometry | |
parent | 0bdc0dba2058acea3af4624cf6419c49feacf554 (diff) |
Make Transform::computeRotationScaling(0,&S) continuous
Diffstat (limited to 'Eigen/src/Geometry')
-rw-r--r-- | Eigen/src/Geometry/Transform.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index 2bb78ab7b..547b3661f 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -1101,12 +1101,12 @@ EIGEN_DEVICE_FUNC void Transform<Scalar,Dim,Mode,Options>::computeRotationScalin Scalar x = (svd.matrixU() * svd.matrixV().adjoint()).determinant(); // so x has absolute value 1 VectorType sv(svd.singularValues()); - sv.coeffRef(0) *= x; + sv.coeffRef(Dim-1) *= x; if(scaling) *scaling = svd.matrixV() * sv.asDiagonal() * svd.matrixV().adjoint(); if(rotation) { LinearMatrixType m(svd.matrixU()); - m.col(0) /= x; + m.col(Dim-1) /= x; *rotation = m * svd.matrixV().adjoint(); } } @@ -1130,12 +1130,12 @@ EIGEN_DEVICE_FUNC void Transform<Scalar,Dim,Mode,Options>::computeScalingRotatio Scalar x = (svd.matrixU() * svd.matrixV().adjoint()).determinant(); // so x has absolute value 1 VectorType sv(svd.singularValues()); - sv.coeffRef(0) *= x; + sv.coeffRef(Dim-1) *= x; if(scaling) *scaling = svd.matrixU() * sv.asDiagonal() * svd.matrixU().adjoint(); if(rotation) { LinearMatrixType m(svd.matrixU()); - m.col(0) /= x; + m.col(Dim-1) /= x; *rotation = m * svd.matrixV().adjoint(); } } |