# Calculating a curve

1. Mar 24, 2010

### Bosduif

Hello

1. The problem statement, all variables and given/known data
I have two known points A and B. I want to throw a ball from A to B with a certain angle. Obviously I also know the gravity.

For example: (in metres)

Known
point A: (0, 0, 0)
point B: (30, 0, 10)
direction: (0.949, 0, 0.316)
gravity: 9.82 m/s
angle: 45° or PI / 4

Wanted
acceleration: ?

How can I calculate the initial acceleration needed at point A for the ball to land on point B?

2. Mar 24, 2010

### jbunniii

Do you mean initial velocity?

If you do mean initial acceleration, then how is that acceleration assumed to be applied to the ball, i.e., is it constant acceleration for some time window, or what?

3. Mar 24, 2010

### Bosduif

Yes, I meant velocity, the initial speed at which the ball is thrown
I'm sorry, English isn't my primary language and I always get the two mixed up

4. Mar 24, 2010

### jbunniii

No problem.

I would like to clarify one more thing. Are the (x,y,z) coordinates oriented such that +z = up, i.e. point B is 10 meters higher than point A?

5. Mar 24, 2010

### Bosduif

Oh, I'm using a Y is up system but the position doesn't really matter.
The final purpose is that I have a thrower and a target which moves around. The thrower throws a ball with a certain speed towards the target. The ball always has to hit the target.

In one case know the starting point, the point of destination and the angle (direction vector) and I need to know the speed to multiple with the direction so that it will hit the target.

6. Mar 24, 2010

### jbunniii

Well, the vertical coordinate does matter. If the points are at different heights then certain throwing angles might not even work, no matter what velocity you use.

But let's assume both points are at the same height, and we don't even need to work in three dimensions. Just use a coordinate that points from A to B. All that matters is their distance apart. Furthermore, we can define the origin to be point A.

So let's reformulate the problem as follows:

I want to throw a ball from the origin (0,0) to some point (d,0), where d is a horizontal distance. The second (y) component is height.

The angle is constrained to be 45 degrees. Choose an initial velocity so that the ball will hit the target.

We can define the velocity as a function of time as follows.

$$v(t) = [v_x(t), v_y(t)]$$

where $v_x(t)$ is the horizontal velocity and $v_y(t)$ is the vertical velocity. We will assume the ball is thrown at $t = 0$.

Note that the 45 degree throwing angle means

$$v_x(0) = v_y(0)$$

We can also define the position as a function of time:

$$p(t) = [p_x(t), p_y(t)]$$

where we assume

$$p_x(0) = p_y(0) = 0$$

The velocity and position vectors are related as follows

$$\frac{d}{dt}p(t) = v(t)$$

Finally, we can define an acceleration vector

$$a(t) = [a_x(t), a_y(t)]$$

which relates to velocity as follows

$$\frac{d}{dt} v(t) = a(t)$$

So let's start with acceleration. What are $a_x(t)$ and $a_y(t)$?