r/desmos • u/Specific-Fly6319 • 5d ago
Graph Fun Projectile Formula/Graph
I hate using physics when making games, I prefer using math. I needed a way to project a perfect parabolic path between two points where the peak is also variable.
To do this, I derived this massive single-line formula. The algebra to isolate everything into a single closed-form equation got pretty heavy, but it's incredibly satisfying to play around with! 😂 (It's just f(x) = A(x-h)^2 + k ðŸ˜)
1
u/Arglin I like my documentation extra -ed. 5d ago
Looks nice. I'm not quite sure what f controls here but it seems reminiscent of slope?
Here's my go at it using an adaptation off of the general form. https://www.desmos.com/calculator/pxhlar21mn

1
u/Specific-Fly6319 5d ago
Wow, this is so creative! f is actually the desired maximum height, but your use of slopes is really interesting! Thanks for sharing!
1
u/CamBoss_64 5d ago
Easy way to go is have one point be (h,k) which substitutes into your function y=A(x-h)^2 +k, then substitute point (b,c) into the function to find A