Get the position and orientation from an affine transformation

I have a computed matrix for the transformation of an object in the game world, and I want to compute its position and orientation. Is there a function to do this in nalgebra/nphysics?

Pointless waffle wrote before I’d thought about what I actually need:

I’m going to define a graphics transformation as a scale, followed by a rotation, followed by a translation in affine space because I don’t know its name (please help me here :smiley: ).

We know that the set of linear transformations is closed under composition (multiplication of matrices), but what about the space of graphics transformations? (A set of operations is closed under composition if the composition of 2 operations is also an operation.) I asked this question on stack overflow, and the answer was basically that it is closed if you use only uniform scaling, but I think it’s slightly more general than this - I think the set is closed as long as any non-uniform scaling happens before any rotation, and it might be iff. I haven’t actually tried to prove this though.

Some more information:

In general it is always possible to decompose an affine transformation into a (T∘R1∘S∘R2), where T is a translation, R1 and R2 are rotations, and S is a non-uniform scale. The RSR part is a SVD on the 3x3 matrix, and the translation can be read off. If you want (R1∘S∘R2∘T) you need to map the translation through the rotations and scale.

It seems that there is a trait for this in alga (alga::linear::AffineTransformation), but that this isn’t implemented for anything in nalgebra. Would people be amenable to me implementing it?