Bezier curve trajectory

Hello! I’ve been messing around with bezier curves for a bit, specifically for projectile trajectory. Now I’ve been wanting to achieve something. But I do not know what values to plug in.

This is the trajectory I am aiming for:

Excuse me for the bad sketch.


The formula I use (from wiki):

function quadBezier(t, p0, p1, p2)
	return (1 - t)^2 * p0 + 2 * (1 - t) * t * p1 + t^2 * p2

What I want to know is, what values should I plug in for p0/2 to get this trajectory?

Let me know.


It would all depend on the distance from start to finish, plus this is a 2D version so if you want it in 3D you would need to do some extra math.

P0 is the start point
P1 Is a point that raises the curves height (It will not reach this point)
P2 Is the end point for the curve

These images are from the Bezier curve API and will show this visually.


1 Like

Can’t help you figure out what to plug in if you don’t tell us what you’re trying to achieve :smile:

1 Like

Hey, late replied guys sorry. Ended up getting my ideal trajectory by using a cubic bezier instead of a quadratic bezier.

I know you solved this but

Projectiles make parabolic trajectories

Which you can represent exactly with a quadratic bezier if you wanted:

But I feel like you’d have better results just computing and using the parabola in the first place. This wiki page has some good info:

I plotted some of those equations here which you might also find useful: Projectile Motion Calculation

Thank you, I’ll be sure to check it out.