| 06-12-2006, 01:05 AM | #1 |
Seems like I should know this, but after thinking about it I really don't know much about parabolas ><. What I want is a formula for a parabola that allows for a differing heights and distances (x and y values). I know how how to create an equation that will do that, but not to have it cross (0,0) every time. This is for a jump/knockback spell, in case you were wondering. |
| 06-12-2006, 01:20 AM | #2 |
We want it go from 0,0 up to L/2,h back down to L,0. Constructing polynomials when we know all the roots is easy, just multiply them together: y = a x (L - x) We've still got one free parameter, a, which is easy to solve for h = a (L/2) (L - L/2) a = 4h/L^2 y = (4hx/L^2) (L-x) Of course this needs to be rotated in the plane somehow since by y we really mean z. So just replace "x" with distance from the origin, which I assume you'll set via something like x = vt. Watch out for the L^2 in the denominator. I recommend a little softening, e.g. y = (4hx/(L^2+1000)) (L-x) |
| 06-12-2006, 01:27 AM | #3 |
Ah ok. Thanks. |
