Archived

This topic is now archived and is closed to further replies.

xDS4Lx

Matrix Inverses

Recommended Posts

xDS4Lx    126
Ok, im having some problems trying to figure this out. Ive been wrtiting a routine to solve this but it keeps messing up with this 1 particular input.
  
{3 0       0     }
{0 cos(t) -sin(t)}
{0 sin(t)  cos(t)}
  
Can someone please walk me through the steps for this? Im using an Identity matrix to try to solve like this:
  
{3 0      0      | 1  0  0}
{0 cos(t) -sin(t)| 0  1  0}
{0 sin(t)  cos(t)| 0  0  1}
  
Anyone please this is really important, thanx in advance

Share this post


Link to post
Share on other sites
Hway    122

Heh. I tried inverting rotation matrices (well, those had all 3 axis though) with gaussian method myself, but couldn''t make it work, there was always some error somewhere.

If you were using any normal 3d rotation matrices (around xyz, zyx, yx, zx, whatever), simply transpose would suffice. I am not sure of this, but it might do the trick in this case too, you might need to change ''3'' to ''1/3'' to make it work though.


Share this post


Link to post
Share on other sites
grady    122
If you want to use gauss-jordan elemination you will either have to pull out some trigonometric identities or convert the cosines and the sines into complex exponentials and do the algebra that way, then convert back to cosine and sines when you''re done.

Share this post


Link to post
Share on other sites
grhodes_at_work    1385
In the future, please do not post double threads. You may have missed my response to your original thread because of this duplicate. For *this* time, I''m copying my response to this thread, and deleting the original thread. In the future, I may simply delete one of the duplicate threads without taking any other action.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post


Link to post
Share on other sites
grhodes_at_work    1385
There should be any number of web sites that describe Gaussian Elimination to solve problems like Ax = b. Your problem is similar. You''re solving a problem with multiple right-hand sides (the columns of the identity matrix). Try this link for example code:

http://developer.intel.com/design/pentiumiii/sml/24504301.pdf

They do provide code for a 4x4 matrix, and since they''ve unrolled loops and things its a bit awkward to convert back to a 3x3.

They also provide code for using Cramer''s rule on a 4x4 matrix, which for up to a 4x4 matrix (and not really anything larger) can be more efficient than Gaussian Elimination.

Also, looks like you''re trying to find an inverse transformation matrix, which has a closed form inverse if you know the rotation angle, translation, and scale values. Do a web search on "inverse transformation matrix." Perhaps look at www.realtimerendering.com, or the articles on gamedev.net.

In any case, by inspection, the inverse to the matrix you give, is, explicitly:


[-1/3 0 0 ]
| 0 cos(t) sin(t)|
[ 0 -sin(t) cos(t)]


Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.


Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post


Link to post
Share on other sites
grhodes_at_work    1385
quote:
Original post by grady
If you want to use gauss-jordan elemination you will either have to pull out some trigonometric identities or convert the cosines and the sines into complex exponentials and do the algebra that way, then convert back to cosine and sines when you're done.


Not true at all. If you want the inverse for fixed values of the angle, just evaluate the values of the sin and cos terms and do Gauss-Jordan elimination on the numerical matrix. If you need to keep the sin and cos terms, there is no need to do any numerical method or algebra as there's a closed form solution. See my other post here.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Edited by - grhodes_at_work on February 7, 2002 11:18:12 AM

Share this post


Link to post
Share on other sites