Jump to content
  • Advertisement
Sign in to follow this  
giugio

2 component axis and 2x2 matrix rotation

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!