This is driving me a little nuts. I have a programming need that requires a parabolic trajectory. I must technically do this in 3 dimensions but I think the problem reduces to resolving equations in just 2 planes, which will have almost identical structure. So I just need the 2d case figured out.

enter image description here

what is the general formula for an upside-down parabola when 2 points are are known, one of them on the x-axis (although if that isn't required that would be more useful for a general sol'n) and the maximum height is known? The vertex is not known (although the generic formula $(b/2a,\mathbb{height})$ should hold.

I figured this should be a simple system of 3 linear equations (at worst) but I keep messing it up and I'm pretty embarrassed at this point. Has anybody done this?


Thanks to @Yves Daoust for posting instructions. Define the following: $$X_{START} := X_S, \\ Y_{START} := Y_S, \\ X_{END} := X_E, \\ Y_{END} := Y_E, \\ \mathbb{midX} := X_M, \\ \mathbb{height} := Y_M. \\$$

We want a formula of the sort

$$Y = Y_M - C \left(X - X_M\right)^2$$

By following Yves Daoust's instructions, you get

$$ X_M = \frac{X_E \sqrt{\frac{Y_M - Y_S}{Y_M - Y_E}} - X_S}{\sqrt{\frac{Y_M - Y_S}{Y_M - Y_E}} - 1} \quad , \quad \frac{X_E \sqrt{\frac{Y_M - Y_S}{Y_M - Y_E}} + X_S}{\sqrt{\frac{Y_M - Y_S}{Y_M - Y_E}} + 1}\\C = \frac{Y_M - Y_E}{\left(X_E - X_M\right)^2}$$

For the formula to work, we will need $\left(X_S <= X_M <= X_E\right)$ or $\left(X_E <= X_M <= X_S\right)$. Only one value will meet this criteria.


A parabola with apex at $(X_m,Y_m)$ is


You can express two extra crossing points,

$$Y_s=Y_m-c(X_s-X_m)^2$$ and $$Y_e=Y_m-c(X_e-X_m)^2.$$

Now by eliminating $c$,


You can solve for $\dfrac{X_s-X_m}{X_e-X_m}$, then for $X_m$ and for $c$. You will find two solutions, of which one can be rejected.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.