main/src/georegression/metric/ClosestPoint2D_F64.java
public static double closestPointT( LineParametric2D_F64 line,
										Point2D_F64 p ) {
		double t = line.slope.x * ( p.x - line.p.x ) + line.slope.y * ( p.y - line.p.y );
		t /= line.slope.x * line.slope.x + line.slope.y * line.slope.y;

		return t;
	}
public static double closestPointT( LineParametric2D_F64 line,
										Point2D_F64 p ) {
		double t = line.slope.x * ( p.x - line.p.x ) + line.slope.y * ( p.y - line.p.y );
		t /= line.slope.x * line.slope.x + line.slope.y * line.slope.y;

		return t;
	}
public static double closestPointT ( LineParametric2D_F64 line , Point2D_F64 p ) { double t = line . slope . x * ( p . x - line . p . x ) + line . slope . y * ( p . y - line . p . y ) ; t /= line . slope . x * line . slope . x + line . slope . y * line . slope . y ; return t ; }
<p>
Computes the closest point along the line as a function of 't':<br>
[x, y] = [x_0, y_0] + t·[slopeX, slopeY]
</p>

@param line The line along which the closest point is being found. Not modified.
@param p	A point. Not modified.
@return Distance as a function of 't'
<p > Computes the closest point along the line as a function of t : <br > [ x y ] = [ x_0 y_0 ] + t· [ slopeX slopeY ] < / p >