- #1
QuaternionKid
- 3
- 0
Homework Statement
Find [itex]\vec{v}_{P}[/itex] (initial velocity) for a projectile with an arbitrary[itex]\left\|\vec{v}_{P}\right\|[/itex] (fixed initial speed), constant acceleration [itex]\vec{a}_{P}[/itex], and starting position [itex]\vec{p}_P[/itex] so that it will intercept an object whose movement is described by the equation [itex]T(t) =\vec{v}_{T}\cdot t + \vec{p}_{T}[/itex].
All vectors are elements of [itex]R^{3}[/itex].
Homework Equations
Position of projectile:
[itex]P(t) = \frac{1}{2} \cdot \vec {a}_{P} \cdot {t}^{2} + \vec {v}_{P} \cdot t + \vec {p}_{P}[/itex]
Position of target object:
[itex]T(t) =\vec{v}_{T}\cdot t + \vec{p}_{T}[/itex].
Unknowns:
[itex]\vec{v}_{P}[/itex] (Projectile velocity)
Knowns:
[itex]\left\|\vec{v}_{P}\right\|[/itex] (Projectile speed)
[itex]\vec{a}_{P}[/itex] (Projectile acceleration)
[itex]\vec{v}_{T}[/itex] (Target velocity)
[itex]\vec{p}_{P,T}[/itex] (Both Projectile and Target initial positions)For a general solution, the projectile's acceleration would be [itex]<{a}_{x}, {a}_{y}, {a}_{z}>[/itex], but I've been letting it be [itex]<0, 0, -9.8m/{s}^{2}>[/itex] for my own convenience.
The Attempt at a Solution
I'm trying to give the AI of a video game I'm making the ability to "lead" moving targets with arrows which experience gravity drop. The arrows always come out at the same initial speed, so I need to solve for the direction in which to shoot them in order for them to hit a moving target.
I've solved the problem for projectiles which have a constant velocity by letting [itex] \left\| \vec{v}_{T}\cdot t + \vec{p}_{T} \right\| = \left\|{v}_{P}\right\| \cdot t + \left\|\vec{p}_{P}\right\|[/itex], simplifying, then finding the time of interception using the quadratic equation. You can basically just plug the time of interception into the target's position function to get the direction vector you have to aim into score a hit.
I don't know how to set up the solution for projectiles which have acceleration (gravity drop) though. So far I've tried to solve for each of the components individually, but that leads me to a place from where I don't know how to continue.
Last edited: