# Calculate initial speed to launch the cat at specific spot

BACKGROUND: I’m trying to create a game where cat jumps from platform to platform, but as any other cat this furry devil won’t do the things I’m asking for. I want the cat to jump and land at the specific spot but I don’t know how to do it.

PROBLEM: I know cats coordinates $(X_c,Y_c)$ and the target spot coordinates $(X_t,Y_t)$. The target spot is always further along the $X$-axis but it can be placed lower or higher than the cat. Whenever the cat jumps and is in the air his velocity along $X$ is constant ($V_x$) and there’s gravity affecting him ($G$). How can I calculate the right starting velocity along the $Y$-axis ($V_y$) so the cat can reach $(X_t,Y_t)$?

• You can just use kinematics and trigonometry to figure it out. – HDE 226868 Aug 18 '14 at 20:33

Hint:

$$x(t) = x(0) + v_x(0)t \\ y(t) = y(0) + v_y(0)t - 0.5 gt^2,$$

where $x(t),y(t)$ are positions as functions of time $t$, $v_x(t), v_y(t)$ are the components of velocity, and $g$ is the acceleration due to gravity. Assumption is that $x$ is positive to the right, and $y$ is positive up.

Some thoughts:

You know that:

$$\color{blue}{m_c\frac{\mathrm{d}^2 \mathbf{r}(t)}{\mathrm{d} t^2} = \sum F_{\text{cat}} = m_c \mathbf{g}, \quad \mathbf{r}(t=0) = (X_c,X_c), \quad \dot{\mathbf{r}}(t=0)=(v_{0x},v_{0y}), \quad t >0,}$$

where we have assumed no drag force acts on the cat, $m_c$ is the mass of the cat, $\mathbf{g} = (0,-g)$ where $g$ is the acceleration due to gravity, $\mathbf{r} = (x(t),y(t))$ is the position vector of the cat and $v_{0x,y}$ are the horizontal and vertical initial velocity of the cat, respectively.

The terminal condition $\mathbf{r}(t_F)= (X_t,Y_t)$ together with the specification of the initial shooting angle, $\tan{\alpha} = v_{0y}/v_{0x}$, should close the problem ($t_F$ is the time for which the cat reaches the platform).

Cheers!

• If you can't take it from here, let me know and I will glady elaborate on my answer. – Dmoreno Aug 18 '14 at 21:09