PDA

View Full Version : Rotations with sin(-theta) & -sin(theta)



baconbeastnz
10-07-2008, 08:08 PM
Hello!

so glRotate(theta, 0, 0, 1), would create the matrix:
(simplified)

cos(theta) -sin(theta)
sin(theta) cos(theta)

correct?

So would glRotate(-theta, 0, 0, 1) create the matrix:

cos(theta) -sin(-theta)
sin(theta) cos(theta)

?

And if I somehow end up with the transpose I.E :

cos(theta) sin(theta)
-sin(theta) cos(theta)

How would that affect the rotation?

overlay
10-08-2008, 10:19 AM
You are wrong on the second matrix, it should be:

cos(theta) -sin(-theta)
sin(-theta) cos(theta)

remember that sin is an odd function, ie
for all x in R, sin(-x)=-sin(x)

so you can rewrite it as:

cos(theta) sin(theta)
-sin(theta) cos(theta)

which is the transpose.

In general, for an orthonormal matrix M, the inverse of M is
the transpose of M. A rotation matrix is a special case of orthonormal matrix: its determinant is equal to 1. So you can
apply this rule to any rotation matrix. Geometrically, if you
rotate theta one way, the inverse transform is to rotate theta
the other way, ie to rotate -theta the same way.

In general, the inverse of an invertible square matrix is not its transpose. This is just for orthonormal matrices.

Z-Knight
10-08-2008, 10:29 AM
Actually, you are also wrong on the second matrix it should be:

cos(-theta) -sin(-theta)
sin(-theta) cos(-theta)

although, cos(theta) is the same as cos(-theta)...so that is ok.

baconbeastnz
10-08-2008, 09:52 PM
ok I think I've got it

Thanks for your replies. =)

baconbeastnz
10-08-2008, 10:54 PM
Arg wait, so cos(theta) = cos(-theta), so either is fine, what is the standard representation, i was under the impression we didn't change the cos values in any rotations.

dletozeun
10-09-2008, 04:35 AM
This is not a math forum, you should better read about trigonometry.
Anyway, you don't have to care about things like cos(-t) = cos(t) and sin(-t) = -sin(t) this is just a property of these functions and all even and odd functions.

So just put the angle values as they are in the sinus and cosinus functions.