Public Group

# 2 component axis and 2x2 matrix rotation

This topic is 2878 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

hello.
I have the x axis of a 2x2 matrix, how i can calculate the y axis?
Is sufficent rotate the x axis of 90°?
How i can rotate it a 2 dimensional vector of 90°?
I have two classes : a 3dvector(x,y and z) and a 3x3 matrix ?
Can i use these 3d classes for work in 2d?

thanks.

##### Share on other sites
To rotate a 2D vector 90 degrees (or any number of degrees), a generic solution is to build a 2x2 rotation matrix and multiply the vector by it , or alternatively if you are only interested with a 90 degrees rotation, just swap the components and flip the sign of one of the components (which of course does the same thing than multiplying by a matrix, but is a shortcut). See e.g. MathGeoLib: float2::Rotate90CW() and float2::Rotate90CCW().

##### Share on other sites

To rotate a 2D vector 90 degrees (or any number of degrees), a generic solution is to build a 2x2 rotation matrix and multiply the vector by it , or alternatively if you are only interested with a 90 degrees rotation, just swap the components and flip the sign of one of the components (which of course does the same thing than multiplying by a matrix, but is a shortcut). See e.g. MathGeoLib: float2::Rotate90CW() and float2::Rotate90CCW().

thanks and ...i have only a 2d vector , is possible to calculate a 2d simil 3d cross product?
for obtain the second 2d vector of the 2x2 rotation matrix?
thanks

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 15
• 12
• 9
• 11
• 15