Find acceleration component to hit target in 2D plane

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 2K views
nook79
Messages
2
Reaction score
0
Hi. Me and my dad (math teacher) are having some trouble finding the answer to a seemingly fairly easy problem.

It is somewhat similar to projectile trajectory math but with the difference that the projectile have an initial velocity and there's no gravity, only acceleration.

Imagine the game Asteroids. The ship is floating at a certain velocity (x, y).
The ship can accelerate in any direction to move. The acceleration force is constant.
What I want is to find the acceleration component (or angle of acceleration vector) so that the ship will hit a defined target point (x, y).

I can offset all positions and angles so that the ship is at position (0, 0) and the target is at (x, 0) to make calculation easier.
One tricky part is that the ship has a maximum speed (magnitude of velocity component), but the initial velocity can be anything between 0 and maximum speed.

I'd be really happy to see some solution for this, with or without maximum speed of the ship.

Please ask if I'm unclear!

Thanks
Mattias
 
Physics news on Phys.org
I would transform the problem into the initial rest frame of the ship. But with acceleration, especially non constant acceleration (speed limit) there might be no analytical solution. If this is for a computer game, you can solve it numerically by iteration.
 
Under constant acceleration, an object always follows a parabolic trajectory. Just construct the parametric representation of a general parabolic trajectory that has the pre-defined initial position and velocity, and then solve which one of these parabolas goes through the target point.

EDIT: if there's a speed limit, this does not work in all cases
 
Last edited:
Thanks! Sorry for the late reply, the response notification ended up in my trash box.

We came to the conclusion that I would have to solve a quartic equation (even without speed limit), and since it's not really one ship but thousands of particles updating at 60 fps I think I'll have to stick with my current pursuit curve like method.

I'll check out the parabolic trajectory suggestion first though. :)

cheers