Solving 2D Movement with Acceleration: A Puzzling Problem

AI Thread Summary
The discussion focuses on solving a 2D movement problem in game development, specifically determining how to calculate acceleration vectors to reach a target coordinate. The user seeks to find a single acceleration vector that allows an object to pass through a specified point or to stop at that point with zero velocity. They express difficulty in solving the resulting equations, particularly when equating the x and y position equations, leading to complex quadratic formulas. Additionally, they inquire about the role of gravity and other forces in the movement dynamics. The conversation highlights the need for clear definitions and parameters to effectively address the problem.
rippy
Messages
1
Reaction score
0
I'm kind of embarrassed I can't figure this out on my own... It's to be used to determine the movement of objects in a game (2d space). This is quite obviously something that has been solved many times over, but I haven't had any luck searching for an answer, so I thought I'd try here!

Homework Statement



You're given an initial xy-coordinate, an initial velocity vector, a target xy-coordinate, and the magnitude of the acceleration vector. The goal is one of the following:

(a) Find a single acceleration vector which ensures the object reaches the point (i.e. passes through the point).
(b) Determine how to apply acceleration such that velocity is zero when the target is reached (i.e. stop on the point)

I've been primarily trying to figure out the easier (a), but I'd like to figure both out eventually.

Homework Equations



Formulae for acceleration, velocity an position relative to time (these seem obvious so I'll omit them, hope that's okay).

The Attempt at a Solution



For (a): The object is at the point if its x-coordinate and y-coordinate match the target's coordinates at the same time. We can look at the separate x and y equations for calculating the object's position based on acceleration, time, initial velocity and initial position; then, by solving for time, we can equate them. Since we know the magnitude of the acceleration, and (a_x)^2 + (a_y)^2 = a, we have two equations and two unknowns and can solve. However, you end up with two equated quadratic formulae which is a huge pain to attempt to solve.

My next thought was to just try to calculate the ratio of (a_x)/(a_y), but I've had no luck with that either.

This isn't homework, so there's no need to be cryptic! It seems like somewhat of a homeworkey problem though so I thought it would be most appropriate to post here anyway. Currently my game objects are moving around at constant velocity and it is not satisfying at all.

Any help is appreciated, thanks!
 
Physics news on Phys.org


Is gravity involved? Is it a 2-D surface game? Once an object is launched, what forces are there that can slow it down? Lots of definition needed here.
 
Back
Top