# Vector Transforms

• May 2nd 2009, 11:50 PM
ashesman
Vector Transforms
Hi all,

I am working on an assignment and am a little stuck on a question. I will try give an example without using my assignment question (hope it works!).

Given a 2 x 2 transformation matrix:

M = [-5 6]
[ 6 -5]

Q1: Write the tranformation of vector 2xi + 5yj under M
x' = [-10x + 30y]
[ 12x - 25y]

Q2: What angle has the vector above been rotated through? Explain.
So that is where I am a little stuck. I cant seem to figure this out. I tried using cos(a) = ll' + mm' (sum of the products of the direction cosines) but the algebra just blew out. Also tried the formula for the relationship between anlge and the dot product of vectors. I tried drawing and plotting lots of points. They seem to rotate a different amount depending on the initial point!!! So now I am a little out of ideas!

Any help would be greatly appreciated...
• May 3rd 2009, 01:24 AM
warmonk102
I'm not sure, but plugging in simple matrix and graphing it out, it seems that the transformation is just a linear combination with no rotation what so ever.
• May 15th 2009, 11:39 PM
ashesman
After wasting wayyy too much time on this (supposedly simple) problem I still do not have a mathematical answer!

Anybody have any ideas?
• May 16th 2009, 12:29 AM
Gamma
My guess is that as you have created this problem yourself based on a model from something else, you may have misinterpreted what is going on.

I suspect what is going on is that you have redundantly put the coordinate tags on those things. You can either use i and j or like $\displaystyle \hat x$ and $\displaystyle \hat y$ but not both. The action of M on a vector just works like matrix multiplication. It represents a linear transformation from $\displaystyle M:\mathbb{R}^2\rightarrow \mathbb{R}^2$.

So basically you take the vector you are acting on call it $\displaystyle \vec{v}$. In your case $\displaystyle \vec{v}=<2,5>$. You would write it as a column to the right of the matrix M and see where it goes. You should get out a 2x1 column vector, call it $\displaystyle \vec{w}$, in your case it is $\displaystyle <-10+30, 12-25>=<20,13>$.

So you see this matrix has changed your vector in some way. Because I assume you just made up this matrix, it does not actually represent a rotation as you can see the magnitude of this vector is way bigger than the original one, but in general here is how you would find out the degree of the rotation as follows.

$\displaystyle \theta = arccos\left( \frac{v \cdot w}{|v||w|}\right)$

Hopefully I have made some sense to you, I am pretty sure this is what the problem is asking you to do, but I can't be sure.
• May 16th 2009, 01:03 AM
ashesman
The question is worded exactly as I have written above. In fact I only changed the numbers as I did not want to confuse anyone by creating a BS example. I don't know how to work the pretty maths equations but the given vector was 2xi + 5yj where i and j are the unit vectors and x and y are just variables (I assume).
• May 16th 2009, 01:06 AM
Gamma
then plug and chug dude. I gave you the formula you need to calculate the angle of rotation, its just going to be nasty with it all in terms of x's and y's.
• May 16th 2009, 01:50 AM
ashesman
Yeah, I already had a go the other night and got stuck when the algebra blew out! I will have another go at it and see how I get on. Thanks for your help...
• May 16th 2009, 02:00 AM
Gamma
did you alter your matrix M too? Generally a matrix of rotation $\displaystyle \theta$ in $\displaystyle \mathbb{R}^2$ is of the form

$\displaystyle M= \begin{bmatrix}cos(\theta) & sin(\theta) \\ -sin(\theta) & cos(\theta)\\\end{bmatrix}$

But yeah, none of the computations are particularly difficult, you just gotta be careful. If you are having a hard time doing the computations, I can go through it with this example, but I mean if you have changed the numbers there is really no point in us both doing it.
• May 16th 2009, 02:42 AM
ashesman
I would be keen to see an example. I get stuck trying to simplify the bottom line!
• May 16th 2009, 09:10 AM
Gamma
Lets do an example with a matrix that we know what is going to happen. This will rotate $\displaystyle \frac{\pi}{4}$

$\displaystyle M= \begin{bmatrix}cos(\frac{\pi}{4}) & sin(\frac{\pi}{4}) \\ -sin(\frac{\pi}{4}) & cos(\frac{\pi}{4})\\\end{bmatrix}=\frac{1}{\sqrt2} \begin{bmatrix}1 & 1 \\ -1 & 1\\\end{bmatrix}$

$\displaystyle Mv=\frac{1}{\sqrt2}\begin{bmatrix}1 & 1 \\ -1 & 1\\\end{bmatrix}\begin{bmatrix}2x \\ 5y \\\end{bmatrix}= \frac{1}{\sqrt2}\begin{bmatrix}2x +5y \\ 5y - 2x\\\end{bmatrix}$

Dot product of v Mv:

$\displaystyle cos(\theta) = \frac{\frac{1}{\sqrt2}(4x^2 + 10xy + 25y^2 - 10xy)}{(4x^2+25y^2)^{1/2}[1/2(4x^2+10xy+25y^2 + 25y^2 - 10xy + 4x^2)]^{1/2}}=$

$\displaystyle \frac{(4x^2 + 25y^2)^{1/2}}{(8x^2+50y^2)^{1/2}}=\frac{(4x^2 + 25y^2)^{1/2}}{\sqrt2 (4x^2+25y^2)^{1/2}}=\frac{1}{\sqrt2}$

Thus $\displaystyle \theta = arccos(\frac{1}{\sqrt2})=\pi/4$
• May 17th 2009, 02:02 AM
ashesman
Excellent... Not enough info to answer my assignment question, but enough to show how to get there! I have been on the right track but have been getting tangled up trying to simplify the two square roots on the bottom line. I will just keep staring at it until I can get it to come up with a result that is not a page wide!

• May 17th 2009, 06:18 AM
the_doc
Is the matrix in this problem the same one as in your original assignment question?

If it is not and this is a matrix you've concocted then I reckon you're probably making more work for yourself than is necessary. You see the matrix above is not a rotation matrix but looks like it's very close to one i.e. I wonder if your original question had a rotation matrix which you slightly altered for the sake of making a similar problem but destroyed its rotation property.

This matrix has real eigenvalues whilst a rotation matrix would have complex eigenvalues.

In other words this matrix will just scale up the eigenvectors which your vector is composed of so any perceived rotation is only a consequence of differing scaling of the components. As the matrix is symmetric the eigenvectors are orthogonal and are infact at 45 degrees to the x and y axes.

Hence I don't believe there will be any nice simplification in the expression you get from your dot-product calculation!

So to sum up what was the original matrix? If that matrix was of the form of the rotation matrix described above then it should be easy to see that the tangent of the angle can be found directly from the matrix by dividing one element by another.

If this is your original matrix then I'm sorry to say that your angle is going to have to be expressed in terms of x and y.
• May 17th 2009, 02:06 PM
ashesman
My matrix was of the same form as the one above. I just altered the numbers. I think the original was:

[-2 3 ]
[ 3 -2]

the original vector was 3xi + 2yj

Remember this is an assignment question so I am not looking for someone to solve it for me...

I assumed the rotation will be in terms of X and Y but I just cant seem to simplify it enough. the question is not worth enough marks for all this work so I assume I am missing something obvious!
• May 17th 2009, 03:29 PM
the_doc
Well in that case I suggest you use $\displaystyle \tan$ formula to determine the angle of each vector in the plane from the $\displaystyle \mathbf{\hat{i}}$ unit vector and then subtract one angle from the other. For example call the initial vector $\displaystyle \mathbf{v_1}$ and the vector it transforms to $\displaystyle \mathbf{v_2}$ and the angles they make with $\displaystyle \mathbf{\hat{i}},$ $\displaystyle \theta_1$ and $\displaystyle \theta_2$ respectively. Now bearing in mind the tangent is given by the ratio of j component over i component then you will have relations of the form:

$\displaystyle \tan \theta_1 = f(x,y)$

and

$\displaystyle \tan \theta_2 = g(x,y)$ .

Call the angle between the two vectors $\displaystyle \theta$ so then:

$\displaystyle \tan \theta = \tan\left( \theta_2 - \theta_1 \right)$

$\displaystyle = \tan \left( \arctan(g(x,y)) - \arctan(f(x,y)) \right)$

$\displaystyle = \frac{g(x,y)-f(x,y)}{1+g(x,y) \, f(x,y) }$ .

The caveat to this is that you have to keep track of where your vectors are so you know which quadrant $\displaystyle \theta$ would put you in. This depends upon what the values of x and y are and so as they are unknown this expression is fine as it is.

I've tried it and it does lead to much simpler algebra.
• May 17th 2009, 03:45 PM
ashesman
Thanks for that, I will give it a go...
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}