How do I rotate a matrix 45 degrees?

This is a discussion on How do I rotate a matrix 45 degrees? within the C Programming forums, part of the General Programming Boards category; Can someone give me some ideas? Thanks....

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    204

    How do I rotate a matrix 45 degrees?

    Can someone give me some ideas? Thanks.

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    3

    Rotating by 45

    I assume you are talking of rotating a vector or a set of points in a plane or space by 45 degrees.

    To achieve this multiply the matrix by

    cos(pi/4) sin(pi/4)

    -sin(pi/4) cos(pi/4)

    Where pi/4 is the radian equiv of 45 degrees. pi = 3.14169

    The above method will work for a 2x2 matrix.

  3. #3
    #include<xErath.h> xErath's Avatar
    Join Date
    Jun 2004
    Posts
    722
    Quote Originally Posted by Aamrun
    I assume you are talking of rotating a vector or a set of points in a plane or space by 45 degrees.

    To achieve this multiply the matrix by

    cos(pi/4) sin(pi/4)

    -sin(pi/4) cos(pi/4)

    Where pi/4 is the radian equiv of 45 degrees. pi = 3.14169

    The above method will work for a 2x2 matrix.
    Nops.. It'll work for a 3x3 matrix representing a 2d transformation, or state

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C - access violation
    By uber in forum C Programming
    Replies: 2
    Last Post: 07-08-2009, 01:30 PM
  2. Matrix Help
    By HelpmeMark in forum C++ Programming
    Replies: 27
    Last Post: 03-06-2008, 04:57 PM
  3. Temperature conversion...
    By Onslaught in forum C Programming
    Replies: 3
    Last Post: 10-21-2005, 01:15 PM
  4. What is a matrix's purpose in OpenGL
    By jimboob in forum Game Programming
    Replies: 5
    Last Post: 11-13-2004, 11:19 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21