[futurebasic] Re: Pixel rotatin'

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

From: Charlie Dickman <charlied@...>
Date: Wed, 27 May 1998 17:20:26 -0400
>If you have some points on a grid (X,Y) and you want to rotate them (sort
>of like a bit map rotate in a paint program but these are points),
>ah...er...ahem...cough... how do you do it?

In a nutshell, given x and y...

x = r cos(a), y = r sin(a), a = arctan(y/x) where a is the angle that the
line from the origin to the x,y point makes with the x axis. r = sqrt(x^2 +
y^2).

then, to rotate through an angle b, x' = r cos(a+b), y' = r sin(a+b).





Charlie Dickman
charlied@...