main/src/georegression/metric/ClosestPoint2D_F64.java
public static Point2D_F64 closestPoint( LineParametric2D_F64 line,
											Point2D_F64 p,
											Point2D_F64 output ) {
		if( output == null )
			output = new Point2D_F64();

		double t = closestPointT( line, p );

		output.x = line.p.x + line.slope.x * t;
		output.y = line.p.y + line.slope.y * t;

		return output;
	}
public static Point2D_F64 closestPoint( LineParametric2D_F64 line,
											Point2D_F64 p,
											Point2D_F64 output ) {
		if( output == null )
			output = new Point2D_F64();

		double t = closestPointT( line, p );

		output.x = line.p.x + line.slope.x * t;
		output.y = line.p.y + line.slope.y * t;

		return output;
	}
<p>
Finds the closest point on 'line' to the specified point.
</p>

@param line	Line along which the closest point is being found.
@param p	   Point.
@param output Where the solution is stored.  If null a new instance is created. Modified.
@return Closest point on the line.