In article <1161998230.973977.157640@[EMAIL PROTECTED]
>,
m0rdred <idlerstyle@[EMAIL PROTECTED]
> wrote:
>Ok but to use newton's method I need a function in terms of theta right
>and then it's derivative also in terms of theta, correct? If so, am I
>on the right track for the initial function of theta? If not, where am
>I going wrong. Law of Cosines would be helpful but I don't know two of
>the sides right? I know the vector between theEnemy's ****p and
>theTarget, so I know magnitude/distance and angle to it. But I don't
>know what the resulting vector will be for the ****p once I have shot
>the projectile because it is a function of time. Nor do I know the
>magnitude of the resulting vector of the projectile once launched
>because it is a function of time as well. Am I just too confused? ;)
Take it as an iterative solution. Given ****ps at p1 (launcher) & p2
(target) with velocities v1 & v2, and a missile velocity vM, you can
do this in refinements. Initially, guess that time, e.g. t0, is
(p2-p1)/vM (the time it'd take the missile to get from one ****p to the
other, if both were stationary). Then, figure out how long it'd take
with movement: t1 = ((p2 + v2*t0) - p1) / vM. (That assumes only
linear movement, which is fine for now). t1 will probably be a bit
different than t0. But, do it again: t2 = ((p2 + v2 * t1) - p1) / vM.
Keep doing that until your t numbers don't change much-- this should
converge on things.
Nathan Mates
--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A.
Heinlein


|