Path: chuka.playstation.co.uk!news From: Nigel Critten Newsgroups: scee.yaroze.freetalk.english Subject: Re: joystick directions Date: Tue, 09 Jul 2002 15:23:36 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 24 Message-ID: <3D2AF1E8.9060409@100Tinsoldiers.com> References: <3D28AB1D.8010407@100Tinsoldiers.com> <3D29F54D.4040007@100Tinsoldiers.com> NNTP-Posting-Host: modem-135.barrelled.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 Well you guys have done it again, thanks Chris that worked a treat. Now I think its time I took a maths course or something because I obviously missed something at school. I've got loads of theories but it looks like pythag's (no I can't spell his name either) worked :) Keep you eyes peeled for the next mind numbingly stupid question. Cheers again Nigel Chris Wallace wrote: > Ive only ever done this in 2D but did it with the BD turret.. anyway, from > the code you already have you should have the angle inwhich he should run. > All you need to do now is use pythag to find how far in that direction the > analog has been moved.. say: > > sqrt( (dx*dx)+(dy*dy) ); > or if it will work (wouldnt on mine) : > sqrt( pow(dx,2)+pow(dy,2) );