function value = versine_pulse ( t, ta, tb, v1, amp )

%*****************************************************************************80
%
%% VERSINE_PULSE adds a versine pulse to a constant.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 March 2010
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real T, the current time.
%
%    real TA, the time at which the pulse begins.
%
%    real TB, the time at which the pulse finishes.
%
%    real V1, the constant value.
%
%    real AMP, the amplitude of the pulse.
%
%  Output:
%
%    real VALUE, the value of the signal at time T.
%
  value = v1 + ( ta <= t && t <= tb ) * ...
    ( 0.5 * amp * ( 1.0 - cos ( 2.0 * pi * ( t - ta ) / ( tb - ta ) ) ) );

  return
end


