Valid transformation matrix

Maybe in this advanced section I will be more lucky…

Does somebody know how to determinate if a given matrix is a valid homogenous transformation matrix ?

Perhaps by testing the invert matrix and trying to decompose it…

Thanks.

If you want I can give you a matrix to test…

Well, usually a homogeneous matrix for 3D is defined as a 4x4 matrix, a combination of a translation and a rotation. You can be sure that it is a homogeneous matrix if the inverse exists. But I am sure there is a better way to check than that.

Take a rotation defined as a matrix:
R = r11 r12 r13 0
r21 r22 r23 0
r31 r32 r33 0
0 0 0 1

and a translation defined as a matrix:
T = 1 0 0 x
0 1 0 y
0 0 1 z
0 0 0 1

Both of these are valid homogeneous matrices,
one contains a rotation, one contains a translation. Normally homogeneous matrices contain both, that is why 4D matrices are used in 3D. Usually you want to concatenate the matrices, so you have just one matrix to apply to the vertices of objects. For example, if you rotate and then translate:

H = T * R = r11 r12 r13 x
r21 r22 r23 y
r31 r32 r33 z
0 0 0 1

or translate and then rotate:
r11 r12 r13 (r11x+r12y+r13z)
r21 r22 r23 (r21
x+r22y+r23z)
r31 r32 r33 (r31x+r32y+r33*z)
0 0 0 1

Both of these matrices are also valid homog. matrices, they both contain a rotation and translation in 3d. Homog. matrices are defined by their one extra dim., like for 2D, you would use a 3x3 matrix, in 3D, you use a 4x4 matrix. Normally, linear math only has room for rotation, not translation, but if you extend you matrix into an extra dimension, you produce a shear in the extra dimension.

So for a 4x4 homogeneous matrix, the translation information in 3D is just a shear in 4D, but when viewed in 3D, it is non-distinguishable from translation. This stuff comes from affine geometry. A homogeneous matrix is a way to combine points and vectors when viewed from a dimension one lower that the dim. of the matrix.

My problem is that this following matrix:
[ 1 0 0 0]
[ 0 0 1 0]
[ 0 -2 0 0]
[ 0 0 0 1]
give the following decomposition (using my matrix tools):
Position = 0 0 0
Orientation = -1 0 0 1.5708
Center = 0 0 0
Scale = 1 1 2
ScaleOrientation = 0 0 1 0
but the reprocessed matrix from the last decomposition (always using my matrix tools):
[ 1 0 0 0]
[ 0 -4.37114e-008 2 0]
[ 0 -1 -8.74228e-008 0]
[ 0 0 0 1]

!! Not the same.