interLineLine()

Synopsis

Returns the point of intersection between the infinite lines defined by respective points and vectors . An error is signaled if the lines are parallel. If the lines are not in the same plane (skew), the apparent intersection is found. It performs the cross product between the first and the second to determine a normal to the intersection. Then it looks down that normal and returns the apparent intersection on the first line.

Syntax

interLineLine ( p1 As Point, _
                v1 As Vector, _
                p2 As Point, _
                v2 As Vector ) As Point 
Argument Type Description
p1 Point Point on the first line to intersect.
v1 Vector Direction of the first line.
p2 Point Point on the second line to intersect.
v2 Vector Direction of the second line.

Example 1

Intent >interLineLine(point(2,2,0), vector(1,3,0), point(0,0,0), vector(1,0,0)) 
--> Point_(1.333, 0.0, 0.0, WorldFrame()) 
This is the point where the first line crosses the X axis.

Example 2

Intent >interLineLine(point(4,0,0), vector(0,1,0), point(0,0,0), vector(1,1,1)) 
--> Point_(4.0, 2.0, 0.0, WorldFrame()) 
This result is the apparent intersection. The two lines are not parallel, but do not intersect since they cannot be in the same plane. This is the point on the first line closest to the second line.