function yprime = Skydive3(t,y,g,c,m,R)
% yprime = Skydive3(t,y,g,c,m,R)
% t (time) is a scalar and y is a 2-vector whose components are
%            y(1) = x(t)
%            y(2) = v(t).
%
% yprime is the derivative of y at time t.
% Input parameters
% g  gravitational constant (in m/s^2)
% c  drag coefficient (in kg/m)
% m  mass of skydiver (in kg)
% R  radius of earth

yprime = [-y(2); ...   % "-" since altitude is decreasing
          g*R^2/(R+y(1))^2 - (c/m)*(y(2))^2];
