function pdf = chi_pdf ( x, a, b, c )

%*****************************************************************************80
%
%% chi_pdf() evaluates the Chi PDF.
%
%  Discussion:
%
%    PDF(X)(A,B,C) = EXP ( - 0.5 * ( ( X - A ) / B )^2 )
%      * ( ( X - A ) / B )^( C - 1 ) /
%      ( 2^( 0.5 * C - 1 ) * B * GAMMA ( 0.5 * C ) )
%
%    CHI(A,B,1) is the Half Normal PDF;
%    CHI(0,B,2) is the Rayleigh PDF;
%    CHI(0,B,3) is the Maxwell PDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 September 2004
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real X, the argument of the PDF.
%    A <= X
%
%    real A, B, C, the parameters of the PDF.
%    0 < B,
%    0 < C.
%
%  Output:
%
%    real PDF, the value of the PDF.
%
  if ( x <= a )

    pdf = 0.0;

  else

    y = ( x - a ) / b;

    pdf = exp ( - 0.5 * y * y ) * y^( c - 1.0 ) ...
      / ( 2.0^( 0.5 * c - 1.0 ) * b * gamma ( 0.5 * c ) );

  end

  return
end
