# 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. ## How do I rotate a matrix 45 degrees?

Can someone give me some ideas? Thanks.

2. ## 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. 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