function dydt = sling_deriv ( t, y )

%*****************************************************************************80
%
%% sling_deriv() returns the right hand side of the sling ODE.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 May 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real T, the current time.
%
%    real Y(2), the current state values.
%
%  Output:
%
%    real dydt(2), the time derivatives of the current state values.
%
  [ s, t0, y0, tstop ] = sling_parameters ( );

  u = y(1);
  v = y(2);

  r = sqrt ( u.^2 + v.^2 );
  dudt = - v + s * u * ( r - 1.0 );
  dvdt =   u + s * v * ( r - 1.0 );

  dydt = [ dudt; dvdt ];

  return
end

