[futurebasic] point rotation

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 1998 : Group Archive : Group : All Groups

From: Paul Treadwell <limulus@...>
Date: Thu, 28 May 1998 09:56:35 +1200
Mel,
   I can't remember where this came from, probably some comp.graphics site.
I think I thought it would be useful one day!

Subject: 5) How do I rotate a 2D point?

    In 2-D, the 2x2 matrix is very simple.  If you want to rotate a
    column vector v by t degrees using matrix M, use

        M = {{cos t, -sin t}, {sin t, cos t}} in M*v.

    If you have a row vector, use the transpose of M (turn rows into
    columns and vice versa).  If you want to combine rotations, in 2-D
    you can just add their angles, but in higher dimensions you must
    multiply their matrices.

I also have a note on rotating a bitmap.

Hope this helps,
Cheers, Paul