Path: chuka.playstation.co.uk!news From: "John \( QuietBloke \)" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Arc tangent Date: Fri, 31 Aug 2001 00:23:42 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 37 Message-ID: <9mmhv2$ijv6@www.netyaroze-europe.com> References: <9mm95d$h6i12@www.netyaroze-europe.com> NNTP-Posting-Host: host213-122-49-239.btinternet.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Thanx Jon, As it happens I was working on a quick way of calculating the angle. In my particular case my sprites are already pre-drawn in 8 possible angles so all I really want is something very rough ( 45 degree steps ). I was in the process of coming up with something today at work.... it goes along the lines of imagining the circle as an octagon to represent all the angles I can display. First return angles ( as you do ) where x and/or y = 0 ). Roughly speaking 22.5 degrees is when x is a third of y. ( roughly ). If we take the abs of x and y we can then say. If x1*3 0 and y < 0 then angle = 90-angle... etc.. etc.. I think it would work.. and its fine for me.. but your code is much more useful. So now I have 2 working solutions I can use ( Yours and pal's ) using very different techniques.. and of course my dodgy code. Thats the fun of programming.. there are always many solutions to any one problem... beats doing crosswords anyday ! So.. once again... nice one Jon.. I've still to work out how your code works exactly but I will be sure to give credit if I use it... as I would give credit to anyone else who contributes to anything I produce. Eveen if I dont use it.. it gives me something to think about. btw.. sorry about me contantly waffling dribble in this newsgroup about things Im working on... I just figure if Im talking complete rubbish someone will tell me how wrong I am. Cheers John ( QuietBloke )