# Problem with Rotation Matrix

Discussion in 'Homework Help' started by zulfi100, Mar 25, 2015.

1. ### zulfi100 Thread Starter Active Member

Jun 7, 2012
376
1
Hi,
I have got a figure which is related to world to viewing coorinate transformation. The clipping window is rotated so we have to first do translation to origin and then perform rotation. I can understand the translation matrix which is:

1 0 -4
0 1 -3
0 0 1

but i cant understand rotation matrix which is:

0.866 0.5 0
-0.5 0.866 0
0 0 1

I cant understand why we have minus sign in row2 column 1 instead of row 1 column 2. I know the rotation matrix:

cos(theta) -sin(theta) 0
sin(theta) cos(theta) 0
0 0 1

Some body please guide me.

Zulfi.

2. ### MrAl Distinguished Member

Jun 17, 2014
3,625
763
Hi,

It should not be that hard to understand so im sure you're just rushing it.
As you know, sine and cosine functions can have negative values as well as positive values. That's all it takes to get minus signs in the rotation matrix

3. ### zulfi100 Thread Starter Active Member

Jun 7, 2012
376
1
Hi,
Thanks for your response. When will we use negative angle in rotation? In this case, we have to do a clock-wise rotation to align the clipping window with x-axis. Is this the reason ? Kindly guide me.

Zulfi.

4. ### MrAl Distinguished Member

Jun 17, 2014
3,625
763
Hi again,

I think you are talking about the -sin(th) part of the matrix?

As you know, sin(th) goes either positive or negative. It is positive for angles from 0 to pi, and negative for angles from pi to 2*pi. So if we have:
y=-sin(th)
and we got a result where y is positive, then that means that th (theta) must have been between pi and 2*pi because the negative of a negative number is a positive number.
It is really quite simple.
It also helps a lot to graph these things, so you can see how different inputs (th) affect the results. Really we should never do these things without also becoming familiar with their basic plots too, because that gives us an overall picture of what might happen with the functions.

5. ### RRITESH KAKKAR Senior Member

Jun 29, 2010
2,831
91
Hello,
Interesting topic , what you will do of it?

6. ### MrAl Distinguished Member

Jun 17, 2014
3,625
763
Hi,

It sounds like he wants to rotate points around the z axis.
There are other matrixes for rotation around the other axises.

7. ### RRITESH KAKKAR Senior Member

Jun 29, 2010
2,831
91
OK, i guess on LEd display .

8. ### zulfi100 Thread Starter Active Member

Jun 7, 2012
376
1
Hi,
Thanks for the reply. I found on the internet that counter clock-wise rotations are positive whereas clock-wise rotations are negative. But when we rotate about y axis, in 3d domian the sign changes. Can some body guide me what's the problem with this:

Zulfi.

9. ### MrAl Distinguished Member

Jun 17, 2014
3,625
763
Hi,

What's that fourth dimension for, is that for time? For work in Euclidean space you can get away with only three dimensions.

What you should really be doing here (and with some other questions you have) is throwing some numbers in and see what happens. Usually for something that involves a simple change, you can throw one set in and calculate, then another set and calculate, then compare results. This tells you what happened from the first set to the next set. Usually you can increment the first set by a small amount and that manufactures the second set, and so you get two results to compare.
In other words, dont be afraid to experiment with some real world numbers and see what you get, and learn to compare results so that what you are doing begins to make sense. You really have to do this sometimes or else your questions will be unending for the rest of your life.
In this case you want to differentiate between one type of rotation and another, so try it and see what you get, and you might be able to answer your own question, and this will be more rewarding too

If you like we can look at this some more.