Find deceleration for each object that will make them arrive at the same time?

Entity1037

New member
Joined
Aug 22, 2017
Messages
2
This question isn't particularly related to me learning math, I'm trying to just figure out what is required for me to program this attack for a boss in a personal game project of mine. So, sorry if this is in the wrong category.

So I have a bunch of projectile objects starting in the same place, and they all start moving with the same speed at the same time. They all move with angle and speed values in relation to time along a straight path, and don't use x or y velocity, although the angle isn't important for what I'm trying to figure out. The plan is for them to decelerate until they stop. What I want is for all of them to stop at the same time by having each one of them change their deceleration to different values depending on how far they're traveling. They'll move like this:

math problem visualization.png
What I'm having trouble with is figuring out the equation to calculate the deceleration for them to use while they're traveling. Every time I try to do it I just can't find an equation configuration that does what I'm wanting. They all have a known start time, end time, initial velocity, end velocity, start distance, and end distance. But I just can't seem to figure out how to do it. It really seems like something you should be able to do. What am I missing? If someone has the right solution that would be great.
 

Attachments

  • math problem visualization.png
    math problem visualization.png
    2 KB · Views: 2
Last edited:
Nevermind, I figured out my problem. I didn't have enough degrees of freedom, aka enough variables that I could change. By having the initial velocity the same for all of the objects I couldn't also make them arrive at their destinations at the same time. So, I made their initial velocity change too. Here's what I have now:

Vi = 2*s/t - Vf
a = (Vf - Vi) / t

Vi = initial velocity
Vf = final velocity
s = distance to travel
t = final time
a = acceleration
[COLOR=rgba(255, 255, 255, 0.7)]
[/COLOR]
 
Top