19. Volleyball – solution and hints for the example

The motion of the ball after a serve in volleyball is a projectile launched at an angle from some initial height, in this example a height of 1.8 m. In the following picture the path of the ball is shown as a black curve:The motion of the ball during a volleyball serve – projectile motion
Figure 1: The motion of the ball during a volleyball serve – projectile motion

A note for the easier version of the task:

For users who want a simpler version of the task, it is recommended to focus on the basic parameters and to assume that the ball reaches its maximum height exactly above the net (at the coordinate of the net). This approach removes the need to analyse the motion of the ball in the horizontal direction and makes it possible to solve the task with less complex formulas. A more detailed example for this version can be found in task no. 19 on the page Branching in a program – examples. We will look at the motion of the ball in the vertical direction. From the initial height of 1.8 m the ball moves vertically upwards with the initial speed v0 (entered by the user) and reaches some maximum height Hmax (see the picture).


​

Hmax=1.8 + dH

(1)
where dH is the change of height, which we can find with the formula for uniformly accelerated (decelerated) motion in the Earth's gravitational field, where the acceleration is

g = 9.81 m/s2

From the well-known formula for uniformly accelerated motion

s = v0*t - a*t2 / 2

if we put g instead of a, and dH instead of s, because the change of height is actually the distance travelled in the vertical direction, we get:

dH = v0*t - g*t2 / 2

(2)
If we substitute equation (2) into (1), we get

Hmax = 1.8 + v0*t - g*t2 / 2

(3)
If this maximum height is greater than the height of the net (HM, coloured red in the picture above)
then we can say that the ball will go over the net, otherwise it will not. The time t in which the ball reaches Hmax can be found from the formula for the current speed in uniformly accelerated motion:

v = v0 + a*t

Since this is a projectile looked at only in the vertical direction, the speed when the maximum height is reached is equal to zero, and the acceleration is the gravitational one (g). The minus sign shows that the direction of the speed v0 is opposite to the direction in which gravity acts.

0 = v0 - g*t

From here the unknown time t can be found

t = v0 / g

(4)

Additional explanations


The procedure for solving the task (the algorithm)

  1. Define the following data: HM, v0, HMax, dH, g;
  2. The user enters v0 and HM
  3. Set the value of g
  4. Compute the time t with formula (4)
  5. Compute the maximum height of the ball with formula (3)
  6. Using an if-else statement, decide whether the ball goes over the net or not
​

Note: A harder version of the task (see task 32) would ask whether the ball will go over the net, not only whether the height reached by the ball is greater than the height of the net. Then the current height of the ball at the moment when the ball is at the x coordinate of the net would have to be found. The current height computed in this way is H <= HMax.
​ To compute it, the horizontal component of the initial speed must be entered, as well as the horizontal (X) distance of the net from the place where the ball is hit.

Practical use

Analysing the motion of the ball during a volleyball serve is not only a theoretical task – it is widely used in sports science and in training athletes. With this model, coaches and players can optimize their serves, increase precision and adapt their strategy to the situation on the court. Here are some practical uses:
  1. Optimizing the serve:
    • The model lets players analyse how the angle and the speed of the serve affect whether the ball goes over the net. By experimenting with the initial speed and the angle, players can adjust their technique to reduce the chance of a mistake.
  2. Developing competition strategies:
    • By analysing different initial conditions, it is possible to identify the best serves for different situations in the game, such as avoiding the opposing team's blocks or making the reception harder.
  3. Technical analysis of players:
    • With sensors that measure the initial speed and angle, coaches can analyse a player's technique and give precise recommendations for improvement.
  4. Visualization for training:
    • Implementing the model in software with a graphical simulation lets players see the motion of the ball in real time, which helps them understand the effects of their movements better.
  5. Use in education:
    • The task can serve as an example for students who study physics, sports biomechanics or programming, connecting theory with practical and interesting situations.

 Back to the page:  ​Branching in a program – examples