Message-ID: <32354842.65FD@pobox.oleane.com> Date: Tue, 10 Sep 1996 12:51:46 +0200 From: Francois Charton Organization: CCMSA MIME-Version: 1.0 To: Toby Ounsted CC: djgpp AT delorie DOT com Subject: Re: Rotating a point (x,y). References: <96Sep10 DOT 100028bst DOT 26499 AT spy DOT viglen DOT co DOT uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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