Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Homing Device
Author Message
hello

Posted: Tue May 06, 2003 12:06 pm   Post subject: Homing Device

We are trying to do a homing prof\jectile
but we have only creatd something that is weird it first goes diagonally to the x position of the target then the y value changes towards the target
we need to make one that will rite away go diagoanlly to the target and not make a wavy and curvy movement
any ideas
slope of line??..
maybe

Homer_simpson

Posted: Tue May 06, 2003 1:28 pm   Post subject: (No subject)

if you want it to be wavy you could use sine or cosine in your formula
 code: y:=a*(sine(x+b))+c

or use parabola for curves
 code: y:=a*(x**2)+b

I dunno if that's what yer asking for =/

(a,b and c can have any values depending on the curves u want and value of x increases or decreases in order to create a wavy line)
Tony

Posted: Tue May 06, 2003 1:53 pm   Post subject: (No subject)

first you find the distance between between you and your target. Then the X difference and Y difference.

Divide the distance by missile speed, you get number of steps in while your missle will reach its target. Now divide each of the differences on each axis by that number of steps. Thats by how much your missile should move along each axis in turn.
Tony's programming blog. DWITE - a programming contest.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 3 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: