Mail Archives: djgpp/1996/09/10/07:00:27
Toby Ounsted wrote:
>
> Hi all,
>
> Not wishing to go too far off topic, but does anyone have any C code
> (and/or formulae) for rotating a point (x,y) around the origin(0,0) by a
> fixed number of degrees?? I'm sure I did this in Maths at school, but it was
> a _LONG_ time ago...
>
This is quite off-topic, but here is your formula anyway :
let a be the angle you want to rotate, positive a going counterclockwise,
1/ if a is in degrees, convert it into radians (multiply it by PI/180),
2/ the coordinates of the rotated point are
(x*cos(a)-y*sin(a),x*sin(a)+y*cos(a))
Francois
- Raw text -