function [ t, t_relative ] = line_parameter_t ( p1, p2, p )

%*****************************************************************************80
%
%% line_parameter_t() returns the T parameter of a point.
%
%  Discussion:
%
%    If L is the line through P1 and P2, then T is the
%    distance from a point P to that line.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 July 2023
%
%  Author:
%
%    John Burkardt
%
  v1 = p2 - p1;
  v2 = p  - p1;

  nv = [ v1(2), - v1(1) ];

  t = ( nv * v2' ) / norm ( nv );
  t_relative = t / norm ( nv );

  return
end
