Mail Archives: djgpp/1996/09/10/06:44:13
On Tue, 10 Sep 1996, Toby Ounsted wrote:
> 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...
x' = x * cos(A) - y * sin(A)
y' = y * cos(A) + x * sin(A)
where A is the rotation angle measured counter-clockwise from the old
position to the new. Remember to convert the angles into radians before
feeding them to `sin' and `cos'.
- Raw text -