function dydt = squircle_deriv ( t, y )

%*****************************************************************************80
%
%% squircle_deriv() returns the right hand side of squircle_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 December 2020
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    John D Cook,
%    A generalization of sine and cosine,
%    https://www.johndcook.com/blog/2020/12/21/generalization-sine-cosine/
%
%    David Shelupsky,
%    A generalization of the trigonometric functions,
%    The American Mathematical Monthly,
%    Volume 66, Number 10, December 1959, pages 879-884.
%
%  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 ] = squircle_parameters ( );

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

  dudt =     v .^ ( s - 1 );
  dvdt = - ( u .^ ( s - 1 ) );

  dydt = [ dudt; dvdt ];

  return
end

