Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to throw an object in my simulation with several criteria.

Object is thrown from [x0,y0]

object have to pass through point [x1,y1]

the top-most point is [m,n], where n - y1 = y1 - y0.

parabola image

So I have two points and top boundary of projectile motion.

I need to calculate, what linear velocity should I apply to my object in order to follow desired trajectory (no damping is taken into account).

I have tried to calculate it many times, using trajectory equations x=x0+v*t y=y0+v*t-0.5g*t*t and using parabola equation, but every time messed something up.

how can I calculate it?

share|cite|improve this question
up vote 1 down vote accepted

To make things a bit simpler, I'll assume that $(x_0, y_0)=(0, 0)$. We can always translate things back once we're done. Also, to save writing subscripts I'll rename your $(x_1, y_1)$ to be $(a, b)$.

Describing the parabola.

The first thing we'll do is get the equation of the parabola in Cartesian coordinates. Once that's done we'll try to parametrize it as a trajectory, which of course is your ultimate goal. It's almost immediate that a downward-opening parabola through $(0,0)$ with apex coordinates $(m, n)$ is given by $$ y=n-(x-m)^2 $$ In this case, $n=2y_1$ (since $y_0=0$) which in our terms gives $n=2b$. Also, since the parabola contains the origin, we'll have $0=2b-(0-m)^2$, so $m=\sqrt{2b}$ so the parabola will be described by $$ y=2b-(x-\sqrt{2b})^2=2\sqrt{2b}\; x-x^2 $$ The apex will be at $(\sqrt{2b}, 2b)$. Note this, we'll use it shortly.

[Although we won't use it in what follows, we note that since the parabola contains $(a, b)$ it's not hard to show that $a=\sqrt{b}\;(\sqrt{2}-1)$.]

Parametrizing the parabola.

For initial velocity $V$ and elevation angle $\alpha$, the trajectory will be given by $$ \begin{align} x(t) &= V\cos(\alpha)\;t\\ y(t) &= V\sin(\alpha)\;t-\frac{1}{2}gt^2 \end{align} $$ For this trajectory, the apex will be when the derivative $y'(t_{apex})=0$. This gives us $$ t_{apex}=\frac{V}{g}\sin\alpha $$ which gives us $$ \begin{align} x(t_{apex})&=\frac{V^2}{g}\sin\alpha\cos\alpha\ \\ y(t_{apex})&=\frac{V^2}{g}\sin^2\alpha \end{align} $$ So the apex in these terms will be $((V^2/g)\sin\alpha\cos\alpha, (V^2/g)\sin^2\alpha)$. Now recall that the apex is $(\sqrt{2b}, 2b)$ so we'll have $$ \left(\frac{V^2}{g}\sin\alpha\cos\alpha\right)^2=\frac{V^2}{g}\sin^2\alpha $$ from which we find a relation between $V\text{ and }\alpha$: $$ V=\sqrt{\frac{g}{2}}\frac{1}{\cos\alpha} $$ Substituting this for $V$ in the original parametrized equations gives us $$ \begin{align} x(t) &= \sqrt\frac{g}{2}\;t\\ y(t) &= \sqrt\frac{g}{2}\;\tan(\alpha)\;t-\frac{g}{2}t^2 \end{align} $$ Now note that $x^2=(g/2)\;t^2$ and so we now have two equations for our curve, the parametrized version and the Cartesian version: $$ y=\tan(\alpha)\;x-x^2=2\sqrt{2b}\;x-x^2 $$ so we'll have $\tan\alpha = 2\sqrt{2b}$, so, finally, we have the elevation and the initial velocity given by $$ \alpha=\tan^{-1}(2\sqrt{2b})\qquad V=\sqrt{\frac{g}{2}(1+8b)} $$ (since, if $\alpha=\tan^{-1}(2\sqrt{2b})$, we'll have [Edit: $\cos\alpha=\underline{1/\sqrt{1+8b}}$]). These seem pretty reasonable, for example (in English units, rather than metric, since it makes the math a touch tidier),

  • If $b=1$ foot, then $V \approx 12$ ft/sec, max height = 2 feet, horizontal travel $\approx$ 2.8 feet
  • If $b=6$ feet, then $V \approx 28$ ft/sec, max height = 12 feet, horizontal travel $\approx$ 6.9 feet

That was fun. Thanks for posing the question.

share|cite|improve this answer
no no no, I thank you Rick! :) You had to put big effort in this! once again, thank you. I need to apply force by dimension, so I need to apply separately X and Y force. So when alpha is the angle I should apply the force, then cosα=1/(1+8b)=xForce right? And then from pythagoras theorem yForce = (g/2)*(1+8b)-xForce^2 rigt? – relaxxx Oct 19 '12 at 20:04
TxForce is $V\cos\alpha$. We've established that $V=\sqrt{g(1+8b)/2}$ and that $\cos\alpha = 1/\sqrt{1+8b}$ so the xForce should be $\sqrt{g/2}$. yForce is $V\sin\alpha$ which turns out to be just $2\sqrt{gb}$, since $\sin\alpha=(2\sqrt{2b})/\sqrt{1+8b}$. – Rick Decker Oct 20 '12 at 19:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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