LineClosestPoint

Finds the point on an infinite line that is closest to a test point.

Syntax

rhinoscriptsyntax.LineClosestPoint (line, testpoint)

rhinoscript.line.LineClosestPoint (line, testpoint)

Parameters

line

Required.  List of 6 numbers or 2 Point3d.  Two 3-D points identifying the starting and ending points of the line.

testpoint

Required.  List of 3 numbers or Point3d.  The test point.

Returns

Point3d

The point on the line that is closest to the test point is successful.

None

If not successful, or on error.

Example

import rhinoscriptsyntax as rs

line = (0,0,0), (5,5,0)

point = (15, 10, 0)

result = rs.LineClosestPoint( line, point)

if result: rs.AddPoint(result)

Also See

LineIsFartherThan

LineMaxDistanceTo

LineMinDistanceTo

LinePlane

LineTransform