Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have a 1x3 matrix representing a point in space:

[x]
[y]
[1]

And a 3x3 matrix representing an affine 2d transformation matrix

[a][b][c]
[d][e][f]
[g][h][i]

How to I multiply the matrices so that I am given the matrix?

[newX]
[newY]
[w]
share|improve this question
    
I don't understand what you mean. I happen to have some experience in computer vision. The vector $u=[x,y,1]^T$ seems homogeneous coordinates of a 2D point. Let $v=Au$ where $A$ is an affine transformation matrix. I think you can get the coordinates of the new point by multiplying a scalar factor such that the third entry of $v$ is $1$. That is $x_{new}=v(1)/v(3), y_{new}=v(2)/v(3)$. –  Shiyu Mar 27 '11 at 9:02
    
it is a $3*1$ matrix. –  amul28 Mar 27 '11 at 9:06

1 Answer 1

Basic matrix multiplication works here.

$$ \begin{bmatrix} c_x \\ c_y \\ c_w \end{bmatrix} = \begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix} \begin{bmatrix} x \\ y \\ 1 \end{bmatrix} $$

$$ c_x = a\, x + b\, y + c $$ $$ c_y = d\, x + \ldots $$

with your new point at $(x,y) = (c_x/c_w, c_y/c_w)$

You will find examples here.

share|improve this answer

Your Answer

 
discard

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