# Transformation matrix that has no inverse

This topic is 4448 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, How can I overcome the problem of matrices that have no inverses (determinant = 0)? Even very simple transformations may fall victim to it, like: [ 1 0.5 0 ] [ 2 1 0 ] [ 0 0 1 ] which is just a simple 2D skewing. Please help.

##### Share on other sites
When you say this is a problem, why is it a problem? I think the bottom line is that you either have to keep or know the original point.

I think if it in terms of loss of information. For example, if you had this matrix M, which is singular (determinant = 0):

M = [ 1 0 0 ]
[ 0 0 0 ]
[ 0 0 0 ]

M throws away Y and Z but keeps X. Once you transform a point using the above matrix, you have "lost" information. You can only go back to the original point in order to get that information back.

It's not so obvious just by looking at your matrix that it is singular, but since the determinant is 0, it means that you can't find the original point given the transformed point.

##### Share on other sites
Row1 = [1 0.5 0]
Row2 = [2 1 0]
Row3 = [0 0 1]

What you have here is a sticky situation. The main problem I see is that your transformation is linearly dependent. Specifically Row2 = 2 * Row1. When a situation like this arises, you will not be able to invert the matrix since the matrix will then be singular and you lose information just as Tweduk pointed out.

The only way I can think of to solve this problem is to make sure each row in your matrix is linearly independent if you want to invert the matrix. So you could require any transformations to have this property, then when you go to invert the matrix return an error when you get a singular matrix and handle it gracefully.

Anyhow, any transformation you do will work just fine as long as you don't need to invert and untransform (i guess). Do you really need to get the inverse of any transformation you do?

-Dagbud

##### Share on other sites
Are you sure you're going to be dealing with singular transformation matrices that need to be inverted? I instantly think projection matrices, and that's exactly what your example will do, project everything onto a line. Maybe not using the shortest perpendicular distance, but everything will end up on a line nonetheless.

You'll have to make sure that your transformation matrices are invertible before you apply them if you really want to undo them. Any standard transformation matrix should be invertible, or least if it isn't invertible -- such as clip-space to screen-space -- you can make do with a set of untransformed points (i.e. reverse transform a screen-space point into a line).

##### Share on other sites
The problem you have is that the matrix isn't a skew matrix, in 2d it maps all points onto the line y = 2x.

Presumably what you want is to do a skew using this matrix:
[ 1 0.5 ]
[ 0 1 ]

followed by this one
[ 1 0 ]
[ 2 1 ]

which results in this matrix (product of the two transform matrices):

[ 2 0.5 ]
[ 2 1 ]

or, if you do them in the opposite order,
[ 1 0.5 ]
[ 2 2 ]

and both of those are non-singular.

[EDIT: Stuck to 2d to make it simpler]

##### Share on other sites
Thank you very much for the replies.

I see my wrong concept now.
It looks like nothing should be drawn when the matrix is uninvertible.

1. 1
2. 2
3. 3
Rutin
19
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633657
• Total Posts
3013197
×