function [ v, dvdr ] = sinsq_potential ( r )

%*****************************************************************************80
%
%% sinsq_potential() evaluates the sine-squared potential.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 June 2012
%
%  Author:
%
%    John Burkardt.
%
%  Input:
%
%    real R, the distance between two particles.
%
%  Output:
%
%    real V, the value of the potential.
%
%    real DVDR, the derivative of the potential.
%
  v    = ( sin (       min ( r, pi / 2.0 ) ) ).^2;
  dvdr =   sin ( 2.0 * min ( r, pi / 2.0 ) );

  return
end
 
