Path: chuka.playstation.co.uk!news From: Nigel Critten Newsgroups: scee.yaroze.freetalk.english Subject: Re: joystick directions Date: Thu, 11 Jul 2002 19:20:07 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 30 Message-ID: <3D2DCC57.6000807@100Tinsoldiers.com> References: <3D28AB1D.8010407@100Tinsoldiers.com> NNTP-Posting-Host: modem-403.ballistic.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en I told you it wouldn't be long before I had another question :) This is about the shortest way round a circle. Thanks to Pal I can find out where I am pointing, and I know where I want to point so I have a start angle and an end angle, all I want to do is rotate the shortest way, some examples 45 -> 315, anti clockwise 315 -> 45, clockwise 90 -> 270, either way 225 -> 90, anticlockwise 135 -> 45, anticlockwise 45 -> 135, clockwise it all seems quite straight forward, if the start angle is less than the end angle, TURN (clockwise) if the start angle is greater than the end angle -TURN (anti clockwise) but if you look at the first example the shortest direction is -TURN (anti clockwise) but the above would have it going clockwise (the longest way) I know there must be an easy way to do this, but I don't know how, My maths are letting me down a lot at the moment. I hope you understand what I mean :) Cheers Nigel