Computer Science Canada

Homing Device

Author:  hello [ 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

Author:  Homer_simpson [ Tue May 06, 2003 1:28 pm ]
Post 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)

Author:  Tony [ Tue May 06, 2003 1:53 pm ]
Post 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.


: