Ball Velocity as x and y components
The diagonal line to the red ball represents the ball's velocity. The
magnitude of the velocity is fixed at 400 units but the direction may
be changed by moving the slider. When moving the slider the ball
moves around the circle of radius 400 shown because its velocity
magnitude is fixed at 400. The velocity may be projected in both x
and y directions, as shown, depending on the angle of
direction which is shown at bottom left: the x velocity is
then 400*cos(angle) and the y velocity is 400*sin(angle).
The x and y velocities may be projected back on the
direction of travel of the ball. Then the contribution due to the
x projection is cos(angle) times the x velocity or
400*cos2(angle) and the contribution due to the y
projection is 400*sin2(angle), as shown. Observe that
since cos2(angle)+sin2(angle)=1, the sum of the
two projections is 400.