function Y_dot = pingpong_ode(t,Y)

% this function is the ode solver for projectile motion where there are no
% other forces acting on the ball

global m g
% split up the state space vector
% x direction
% r = [Y(1) Y(3)];

% x_dot and y_dot
v_vec = [Y(2) Y(4)];
v_x = Y(2);
v_y = Y(4);

% acceleration
a_x = 0;  %
a_y = -g;  % ft/sec^2 

Y_dot = [v_x;a_x;v_y;a_y];  % the derivative of the state space vectors

end