# LineToLine

Computes the point and angle of the intersection between two lines. If the lines do not intersect, the distance between the lines is computed and returned instead.

## LineToLine Inputs

Parameter | Description
Line 0 | Specifies the coordinates of the first line segment.
X 0 | The x-coordinate of the first endpoint of the first line.
Y 0 | The y-coordinate of the first endpoint of the first line.
X 1 | The x-coordinate of the second endpoint of the first line.
Y 1 | The y-coordinate of the second endpoint of the first line.
Line 1 | Specifies the coordinates of the second line segment.
X 0 | The x-coordinate of the first endpoint of the second line.
Y 0 | The y-coordinate of the first endpoint of the second line.
X 1 | The x-coordinate of the second endpoint of the second line.
Y 1 | The y-coordinate of the second endpoint of the second line.
Show | Specifies the display mode for the function's graphical overlays on top of the image.
0 = hide all | All graphics will be hidden, except when the cell containing the function is highlighted in the spreadsheet.
1 = result graphics only | A line segment showing the minimum distance between the two input lines will be displayed at all times.
2 = input and result graphics | The input lines and the line segment between them will be displayed at all times.

## LineToLine Outputs

Returns | If the two lines intersect, the function returns a Dist data structure containing the point of intersection, the angle between the directed lines segments, and a distance equal to 0. If the two lines do not intersect, the function returns a Dist data structure containing a point for each line, the distance between the lines, and the angle between the directed line segments.
Results | When the function is initially inserted into a cell, a result table is created in the spreadsheet.

## LineToLine Vision Data Access Functions

The following Dist Vision Data Access functions are automatically inserted into the spreadsheet to create the result table:

Label | Function | Description
--- | --- | ---
X0 | GetX(Dist, 0) | If intersecting, the x-coordinate of the point of intersection. If not intersecting, the x-coordinate of the first endpoint of Line 0.
Y0 | GetYl(Dist, 0) | If intersecting, the y-coordinate of the point of intersection. If not intersecting, the y-coordinate of the first endpoint of Line 0.
X1 | GetX(Dist, 1) | If intersecting, the x-coordinate of the point of intersection. If not intersecting, the x-coordinate of the point on Line 1 nearest the first endpoint of Line 0.
Y1 | GetY(Dist, 1) | If intersecting, the y-coordinate of the point of intersection. If not intersecting, the y-coordinate of the point on Line 1 nearest the first endpoint of Line 0.
Angle | GetAngle(Dist) | The angle between the directed line segments.
Distance | GetDistance(Dist) | The distance between lines.