function line_distance_pdf ( )

%*****************************************************************************80
%
%% LINE_DISTANCE_PDF plots the PDF for the line distance problem.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    21 October 2018
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Eric Weisstein,
%    "Line Line Picking." 
%    From MathWorld--A Wolfram Web Resource.,
%    http://mathworld.wolfram.com/LineLinePicking.html
%
  d = linspace ( 0.0, 1.0, 101 );

  pdf = 2.0 * ( 1.0 - d );

  plot ( d, pdf, 'r-', 'linewidth', 2 );
  grid ( 'on' );
  xlabel ( '<-- Distance -->' );
  ylabel ( '<-- Probability -->' );
  title ( 'PDF for distance of random points pairs in unit line segment' );

  return
end

