Date: Tue, 10 Sep 1996 13:22:35 +0200 (IST) From: Eli Zaretskii To: Toby Ounsted Cc: "djgpp AT delorie DOT com" Subject: Re: Rotating a point (x,y). In-Reply-To: <96Sep10.100028bst.26499@spy.viglen.co.uk> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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'.