Results 1 to 6 of 6

Thread: Rotations with sin(-theta) & -sin(theta)

  1. #1
    Member Contributor
    Join Date
    May 2008
    Posts
    67

    Rotations with sin(-theta) & -sin(theta)

    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?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Apr 2007
    Posts
    268

    Re: Rotations with sin(-theta) & -sin(theta)

    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.


  3. #3
    Member Contributor
    Join Date
    Jul 2008
    Posts
    99

    Re: Rotations with sin(-theta) & -sin(theta)

    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.

  4. #4
    Member Contributor
    Join Date
    May 2008
    Posts
    67

    Re: Rotations with sin(-theta) & -sin(theta)

    ok I think I've got it

    Thanks for your replies. =)

  5. #5
    Member Contributor
    Join Date
    May 2008
    Posts
    67

    Re: Rotations with sin(-theta) & -sin(theta)

    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.

  6. #6
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: Rotations with sin(-theta) & -sin(theta)

    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.

Similar Threads

  1. rotations
    By michi in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-06-2008, 05:09 AM
  2. rotations
    By ThunderSoul in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-09-2005, 12:45 PM
  3. Rotations
    By jhc in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 04-03-2003, 07:15 AM
  4. Rotations
    By imported_Scott in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-09-2000, 12:59 PM
  5. Rotations
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-14-2000, 02:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean