Transformation matrices

I never managed to learn my matrices enough to used them practically, so now I have this problem.
I have a coordinate C and a matrix M. I figured out how to apply M to C to get C', but in reality I'll have to start with C' and apply to it the matrix M' to get C.

So the question is, how do I get the matrix M' such that CM=C' and C'M'=C

I found this http://en.wikipedia.org/wiki/Inverse_matrix , but I don't know if this is what I'm looking for.



EDIT: Okay, I think I figured it out, but I'd still like to know if I'm doing it right.

M={ a, b,
c, d }

x=1/(ad-bc)

M'={ xd, -xb,
-xc, xa }
Last edited on
LaTeX tags to write nice formulas would be great (like in wikipedia).

@ helios: you are doing it just right. Just a note: if you want to invert larger matrices don't use "Cramer's rule" (the formula for inverse matrix in Wikipedia). There is a much easier way to do it with "Gaussian eliminations"="row matrix transformations"= might have a few other names. http://en.wikipedia.org/wiki/Gaussian_elimination .In the last link, there is a special subsection about inverting matrices.
Last edited on
Alright, then. I know I won't be inverting matrices bigger than 2x2, so that's not a problem.
just to shoot the breeze, with an old off-topic - open source.

I did end up putting my (one and only) programming project on sourceforge, and actually got a colleague to help me fix the code to compile on a Mac system with the gcc compiler. It turned out this guy had written completely independently MAPLE scripts to do the same as my program (MAPLE= a piece of commercial mathematical software). Now I have a collaborator, both C++-wise and math-wise :). For the time being he hasn't done any serious coding, but he is working on his own algorithm and I will try to charm him to switch to C++ and merge projects.

So, I did reap benefits from open source software, although politically I would be right of the center. Which proves to me completely that open source is the right way of doing software :)
Last edited on
What is this I don't even
Yes, you have it right. Just make sure ad-bc isn't 0.
There is a small detail here: even if ad-bc=0 you might still be able to find M' such that

CM=C' and C'M'=C.

Example:

M={ 1, 1,
1, 1 }

C= {1,1}

C'={2,2}

M'={1/4,1/4
1/4,1/4}
This is another reason one might prefer the Gaussian elimination method to inverting matrices.
Last edited on
Oh, by the way...transforming a coordinate (as a vector) is done by doing Ax (not xA).
It is always dangerous to be Little Endian in a world of Big Endians and the other way round :)

http://en.wikipedia.org/wiki/Lilliput_and_Blefuscu
tition: It doesn't matter. The picture generated by such a transformation would be invisible, so I might as well not waste time.

firedraco: Huh?
What I mean is:

When you applying a transformation 'T' to a coordinate 'x' (i.e. T(x) ), the matrix representation is Ax (not xA, since xA is usually undefined), where A is the matrix associated with T.

Although maybe I am reading your original post incorrectly...when you said 'apply' I thought you were talking about transformations on coordinates.
But... where is xA even mentioned?
In this case, it would be the CM (C is the vector for the coordinate, and M is the tranformation matrix, I think).
The ordinary matrix product is not commutative.
Well, this kind of thing is what I hate most about mathematics (this, and the notation). Why is it called multiplication and uses the same notation as multiplication if the operation isn't commutative?
Yes, I meant MC, but I didn't think any operation called multiplication would make a*b!=b*a.
Yeah, I always call it matrix multiplication, because it is different then just using real numbers.

And the reason why matrix multiplication is defined that (weird) way is so that if you have two transformations S and T, and the associated matrices A and B respectively, then:

S( T(x) ) == A( Bx )
Why is it called multiplication and uses the same notation as multiplication if the operation isn't commutative?


Nobody knows. The commonly accepted rule of thumb is: if you speak of a commutative operation, you call it addition. If you speak of a non-commutative operation, you call it multiplication.

since xA is usually undefined


The expression xM implies that x is a vector row, not a vector column, in which case the multiplication is defined. [Edit: unless it implies x is a scalar. ] Go figure [Edit: *2]. Whether vector rows or vector columns is the right way is a deep philosophical question worthy of human conflict almost as much as the question on which side you break an egg - on the Little End, or on the Big End.
Last edited on
Topic archived. No new replies allowed.