# How to combine a rotation matrix and a stretch matrix into a single matrix for easy Fourier Transform

For full disclosure, this is related to homework. I have to find the Fourier Transform of a function that I've boiled down to the following.

I have a function $f(x,y)$ that I can think of as another function $g(x,y)$ plus a stretch and rotation. (For example, think of turning a circle into an ellipse). So, I have a stretch matrix of:

$$\pmatrix{ \frac{1}{A}& 0\\\ 0& \frac{1}{B}}$$

And I have the standard rotation matrix:

$$\pmatrix{ \cos \theta& -\sin \theta\\\ \sin \theta& \cos \theta}$$

I know that for computing the Fourier transform, $f(Ax)$ is the same as $\frac{1}{det A} F(A^{-T}u)$. So, if I can combine the stretch and rotation into one matrix A, I'm home free. How can I combine these two matrices?

Thanks!

## 1 Answer

You combine those by matrix multiplication.

• Matrix multiplication is not commutative though. Multiplying those two matrices will give different results for the different orderings. – Mark Feb 12 '12 at 22:04
• I understand this is a homework question and hence, approaches to the answers are better than the answer itself. However, perhaps you could be a bit clearer in your answer? Perhaps an explanation of how matrix multiplication helps here (without actually giving away the final answer) will be useful to the OP. – Lorem Ipsum Feb 13 '12 at 3:32
• Then maybe it's more of a linear algebra question and a bit OT in DSP... "Why is it so that the matrix representing the composition of two linear maps is the matrix product of the matrices representing the two linear maps?" – pichenettes Feb 13 '12 at 9:23
• Clearly this linearity property is important to how a system changes in its spatial and frequency representation then. You're right, the whole idea of matrix properties is, at its core, linear algebra. That doesn't make it irrelevant to DSP though, does it? – Mark Feb 13 '12 at 13:03
• @Mark Stretching then rotating IS different than rotating and then stretching. You can probably get valid solutions with either ordering, but they will be different solutions. – Jim Clay Feb 13 '12 at 19:03