Jump to content
  • Advertisement
Sign in to follow this  
broady

Rotation question

This topic is 3492 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 guys, i have 2 vectors v1=(v1.x,v1.y) and v2=(v2.x,v2.y). Suppose the angle th between 'em is less then 90 degrees. Well ok
        |cos th    -sin th|
R1(th)= |                 |
        |sin th     cos th|

describes the CCW matrix rotation that takes v1 on v2(or v2 on v1 depending on the values). Now consider:
    |1-cos th    sin th |
R2= |                   |
    |-sin th    1-cos th|

What does R1 describes? I was thinking something like R2=-R1+I but doesn't make much sense. R1 should have something to do with v1t=(v1.y,-v1,x)(v1 normal) i think. 1 more question: on a resource i am reading that the CCW matrix rotation by 90 degree is
         |0    1|
R90CCW = |      |
         |-1   0|

but
        |0   -1|
R1(90)= |      |
        |1    0|

Where am i wrong? Imo R90CCW describes the CW rotation, am i right? thanks guys Have a nice day Bro!

Share this post


Link to post
Share on other sites
Advertisement
Talking about whether R90CCW or R1(90) is correct makes no sense as long as you don't define whether you use column or else row vectors. The correspondence between the both representations is given by the transpose operation, and notice that this would transfer R90CCW into R1(90) and vice-versa:
R1(90)t = R90CCW
So both may be correct w.r.t. their respective environment, and also both may be incorrect.


Your R2 is actually equal to I-R1. It makes no sense w.r.t. affine transformations (what is presumbly what you meant). I interpret a rotation like R1 this way (assuming you're using column vectors):
Doing the multiplication
R1(th) * v
for the x unit vector (1,0)t gives the new vector
R1(th) * (1,0)t = (cos(th)*v.x,sin(th)*v.x)t
so that for a small positive angle the new y co-ordinate of the old x unit vector is in the positive range. Similarly, for the y unit vector (0,1)t you get
R1(th) * (0,1)t = (-sin(th)*v.y,cos(th)*v.y)t
so that for a small positive angle the new x co-ordinate of the old y unit vector is in the negative range. Both these results denote a CCW rotation.

Share this post


Link to post
Share on other sites
haegarr it's always you, i am happy to meet you again (you helped me 2 months ago with acos and atan2 issues).

Ok i am using column vectors.
So i am fine with R1.

Thank you for all!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!