The energy of the ball is given by:

where m is the mass of the ball, v is the velocity, g is the gravitational acceleration and h is the height of the ball.
The energy dissipated due to air resistance is the difference between the initial energy before the toss and the final energy at the highest point of flight.
