0

In the documentation of Eigen's Transform class, there are two member functions with almost identical signatures:

void computeRotationScaling(RotationMatrixType*, ScalingMatrixType*) const
void computeScalingRotation(ScalingMatrixType*, RotationMatrixType*) const

Both functions have the identical documentation (The multiplication order is rotation * scaling in both functions).

decomposes the linear part of the transformation as a product rotation x scaling, the scaling being not necessarily positive.

If either pointer is zero, the corresponding computation is skipped.

This is defined in the SVD module.

What is the difference between them?

Community
  • 1
  • 1
Henricus V.
  • 898
  • 1
  • 8
  • 29
  • 1
    This is a typo in the doc, the online doc will automatically update soon. The second is of course `scaling x rotation`. – ggael Sep 13 '16 at 07:26

1 Answers1

0

There difference is in the order. If you look closely, the difference is:

// computeRotationScaling
if(scaling) scaling->lazyAssign(svd.matrixV() * sv.asDiagonal() * svd.matrixV().adjoint());
// computeScalingRotation
if(scaling) scaling->lazyAssign(svd.matrixU() * sv.asDiagonal() * svd.matrixU().adjoint());
//                                        ^                                 ^
Avi Ginsburg
  • 10,323
  • 3
  • 29
  • 56