Matrix Multiplication to translate object with given vertices

Phys121VIU
Messages
17
Reaction score
0
This was a question for a test of mine. I am unsure how to translate the object from the left image(Fig.1) to the right (Fig.2). I am to use matrix multiplication..

Do i start with the vertices in Fig.1 as a matrix, as in |0 -1 -2 0 -2 -1 |
...............|0 0 0 2 2 3 |

(I apologize, i don't know how to make large square brackets..)
 

Attachments

  • Midterm4,Q6.jpg
    Midterm4,Q6.jpg
    33.6 KB · Views: 695
Physics news on Phys.org
Phys121VIU said:
This was a question for a test of mine. I am unsure how to translate the object from the left image(Fig.1) to the right (Fig.2). I am to use matrix multiplication..

Do i start with the vertices in Fig.1 as a matrix, as in |0 -1 -2 0 -2 -1 |
...............|0 0 0 2 2 3 |

(I apologize, i don't know how to make large square brackets..)

Hey Phys121VIU.

In terms of translation matrices used in computer graphics, it's easier to use a 4x4 matrix with a 'w' co-ordinate to perform the transformation and then basically project a 4-vector to a 3-vector.

In other words your matrix will look like this:

[a b c d]
[e f g h]
[i j k l]
[m n o p]

where [d h l p]^T is going to be the translation co-effecients corresponding to the vector <x,y,z,w> for translation. If you make the upper LHS 3x3 matrix an identity and your [d h l p] matrix corresond to <Tx,Ty,Tz,0> then when you apply this matrix to a point X you will get Mx = x + T where T is the translation vector above.

Although the output vector is four-dimensional, your w component will be 0 and will reduce to a normal 3d vector if you project it onto the 3-D space where w = 0.

In terms of having a general matrix to do this for all the points, you can not have a 3D matrix that can be applied to all points to give you that result if you want the matrix itself to be a constant as opposed to something that varies with points.

If you want to do it with 3D matrices, then you will have to create a matrix that is a function of the points themselves and this will require extra work.

My guess is that they probably don't want something complicated, so a 4x4 matrix will do the trick along with a projection to the constraint w = 0.
 
Phys121VIU said:
This was a question for a test of mine. I am unsure how to translate the object from the left image(Fig.1) to the right (Fig.2). I am to use matrix multiplication..

Do i start with the vertices in Fig.1 as a matrix, as in |0 -1 -2 0 -2 -1 |
...............|0 0 0 2 2 3 |

(I apologize, i don't know how to make large square brackets..)

\begin{bmatrix}0 &amp; -1 &amp; -2 &amp; 0 &amp; -2 &amp; -1 \\ 0 &amp; 0 &amp; 0 &amp; 2 &amp; 2 &amp; 3\end{bmatrix}
(Click on that to see the code.)

Those are the coordinates of 6 points in two-dimensions. A 2 by 2 matrix, of the form
\begin{bmatrix}cos(\theta) &amp; -sin(\theta) \\ sin(\theta) &amp; cos(\theta)\end{bmatrix}
gives a rotation around the origin through angle \theta. A translation would, normally, be a vector to be added.

But you can, as chiro says, use "projective" coordinates, with point (x, y) represented by (x, y, 1) with the understanding that if some operation causes the third coordinate to change, we divide each coordinate by that to get back to 1- the point (ax, ay, a) is the same point as (x, y, 1). However, I think chiro is giving the case of projective coordinates in 3 dimensions so the matrix has 3+ 1= 4 rows and columns. If you are working in two dimensions so your matrix should have 2+ 1= 3 rows and columns.

Doing that, a translation, adding a to the x-coordinate and b to the y coordinate, is given by
\begin{bmatrix}1 &amp; 0 &amp; a \\ 0 &amp; 1 &amp; b \\ 0 &amp; 0 &amp; 1\end{bmatrix}\begin{bmatrix}x \\ y \\ 1\end{bmatrix}= \begin{bmatrix}x+ a\\ y+ b\\ 1\end{bmatrix}
 
Last edited by a moderator:
\begin{bmatrix}0 & -1 & -2 & 0 & -2 & -1 \\ 0 & 0 & 0 & 2 & 2 & 3\end{bmatrix}

(Click on that to see the code.)

Thanks for this!


Ok i am beginning to understand this question..To translate, say the top point of the object,
\begin{bmatrix}-1 \\ 3\end{bmatrix} to the new coordinate \begin{bmatrix}2 \\ 5\end{bmatrix} i would use
\begin{bmatrix}1 & 0 & 3 \\ 0 & 1 & 2 \\ 0 & 0 & 1\end{bmatrix}\begin{bmatrix}-1 \\ 3 \\ 1\end{bmatrix}= \begin{bmatrix}(-1)+3\\ 3+2\\ 1\end{bmatrix}

That is awesome! Thanks so much

Is there a quicker way to translate all of the coordinates? like in the 2x6 matrix shown above?

It seems if I go about the same method, I would need a 6x6 matrix..?
 
No, you can use the same "translation" matrix, just do it as a single matrix multiplication using all of the points as a single matrix:
\begin{bmatrix}1 &amp; 0 &amp; 3 \\ 0 &amp; 1 &amp; 2 \\ 0 &amp; 0 &amp; 1\end{bmatrix}\begin{bmatrix}0 &amp; -1 &amp; -2 &amp; 0 &amp; -2 &amp; -1 \\ 0 &amp; 0 &amp; 0 &amp; 2 &amp; 2 &amp; 3 \\ 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1\end{bmatrix}=\begin{bmatrix}3 &amp; 2 &amp; 1 &amp; 3 &amp; 1 &amp; 2 \\ 2 &amp; 2 &amp; 2 &amp; 4 &amp; 4 &amp; 5 \\ 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 \end{bmatrix}
 
Last edited by a moderator:
##\textbf{Exercise 10}:## I came across the following solution online: Questions: 1. When the author states in "that ring (not sure if he is referring to ##R## or ##R/\mathfrak{p}##, but I am guessing the later) ##x_n x_{n+1}=0## for all odd $n$ and ##x_{n+1}## is invertible, so that ##x_n=0##" 2. How does ##x_nx_{n+1}=0## implies that ##x_{n+1}## is invertible and ##x_n=0##. I mean if the quotient ring ##R/\mathfrak{p}## is an integral domain, and ##x_{n+1}## is invertible then...
The following are taken from the two sources, 1) from this online page and the book An Introduction to Module Theory by: Ibrahim Assem, Flavio U. Coelho. In the Abelian Categories chapter in the module theory text on page 157, right after presenting IV.2.21 Definition, the authors states "Image and coimage may or may not exist, but if they do, then they are unique up to isomorphism (because so are kernels and cokernels). Also in the reference url page above, the authors present two...
When decomposing a representation ##\rho## of a finite group ##G## into irreducible representations, we can find the number of times the representation contains a particular irrep ##\rho_0## through the character inner product $$ \langle \chi, \chi_0\rangle = \frac{1}{|G|} \sum_{g\in G} \chi(g) \chi_0(g)^*$$ where ##\chi## and ##\chi_0## are the characters of ##\rho## and ##\rho_0##, respectively. Since all group elements in the same conjugacy class have the same characters, this may be...

Similar threads

Replies
9
Views
2K
Replies
14
Views
3K
Replies
7
Views
2K
Replies
5
Views
1K
Replies
5
Views
2K
Replies
2
Views
1K
Replies
3
Views
1K
Back
Top