From e741b436684da485a9abd6d46686a0be143296e0 Mon Sep 17 00:00:00 2001 From: Essex Edwards Date: Mon, 14 Dec 2020 13:03:46 -0800 Subject: Make Transform::computeRotationScaling(0,&S) continuous --- Eigen/src/Geometry/Transform.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Eigen/src/Geometry') 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::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::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(); } } -- cgit v1.2.3