Projectile Motion Using Parametric Equations

Hello everyone! I was thinking about how I should program custom projectile physics for the game I am making, and, with the end of the school year, I just finished a unit on parametric equations. I haven’t seen anything about this yet, so I decided to write an article about its applications to roblox physics.

What is a parametric equation?

A parametric equation is simply a “function” with a third parameter–an independent variable, often time. These work by having two functions, x(t) and y(t) that output a value given t. Those will then be the coordinates of the point at t=a.

How does this work?

Basically, how this works, is you can construct two equations of time, and we can use it to find the arc the projectile will travel.

For example, we will create two customizable functions using physics.

X(t) is equal to the initial starting point, or the x axis of the origin, added to the velocity multiplied by time. Assuming there is no wind or air resistance and we are on a frictionless plane This will give us a linear equation: x(t) = vt+o

Y(t) will be equal to the origin’s y coordinate and the velocity multiplied by time. However, we also need to account for the downward deceleration. Since the gravity on Roblox is just -workspace.Gravity, we can define it as G to get our gravity. Next, we have to integrate time. This will give us t^2/2. Now, we can add these up to get a quadratic equation: y(t) = -gt^2/2+vt+o

To find the restrictions of time, we can use the quadratic formula to solve for y(t)'s roots, or when the projectile has touched the ground. In this case, a = -g/2, b = v, and c = o. Using Desmos, we can visualize how the arc of the projectile will travel, and how the graph transforms when we alter the value of variables.

I don’t really know how this could be useful rather than using other maybe simpler methods, besides the fact that you can plug in anything for time and it will give you the coordinates of the projectile. This could be useful for replays. You could also use Calculus for these to differentiate it and find the instantaneous speed at any given time, and find the distance the bullet traveled by integrating the curve.

I hope you all can learn something from this and that maybe this could be used to create more advanced things.

If enough people would like me to make a module on this, I might.

I hope this finds all of you well, if you have any questions or comments, please ask me, and have a great rest of your day/night!

3 Likes