Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I have an angle e.g. 180 degrees, and I know that an image scales to 1.5 of its size, how do I map these to a 2D transformation matrix? Thanks!

share|cite|improve this question
You are repeating yourself: – draks ... Feb 10 '12 at 19:00
up vote 1 down vote accepted

A rotation matrix (which rotates a vector an angle $\theta$ in the plane) is given by $$ R = \begin{bmatrix} \cos \theta & -\sin\theta \\ \sin \theta & \cos \theta \end{bmatrix} $$ (see To scale by a factor $\alpha$ (i.e. multiply both components of a vector by $\alpha$), apply the transformation $$ S = \alpha I = \begin{bmatrix} \alpha & 0 \\ 0 & \alpha \end{bmatrix} $$ The desired matrix is obtained by multiplying these together, i.e. $ A = RS $ (or, equivalently, $A = SR$, since $S$ commutes with every other matrix); the result is easily seen to be $$ A = SR = RS = \begin{bmatrix} \alpha \cos \theta & -\alpha \sin \theta \\ \alpha \sin \theta & \alpha \cos \theta \end{bmatrix} $$ If you want to scale by a factor $\alpha$ in the $x$-direction and a factor $\beta$ in the $y$-direction, you would use $$ S' = \begin{bmatrix} \alpha & 0 \\ 0 & \beta \end{bmatrix}$$ instead, and multiply as before, but now the order matters (in general, you have $R S' \neq S'R$).

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.