function x = triangle_sample ( a, b, c )

%*****************************************************************************80
%
%% triangle_sample() samples the Triangle PDF.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 September 2004
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A, B, C, the parameters of the PDF.
%    A <= B <= C and A < C.
%
%  Output:
%
%    real X, a sample of the PDF.
%
  cdf = rand ( 1, 1 );

  x = triangle_cdf_inv ( cdf, a, b, c );

  return
end
