LineEdgeIntersection Cellzilla2D Home

Description

Determines if a ray from a point in a given direction intersects a given line segment.

Needs["Cellzilla2D`"];

Return Value

LineEdgeIntersection[lineSegment, point, direction ] returns the coordinates {x,y} of the intersection between a line segement and a line passing through point and $Failed otherwise.

lineSegment={{x1,y1}, {x2,y2}} - endpoints

point={a,b} - coordinates

direction={vx,vy} - direction vector of the line. The iine is assumed to pass through point and be parallel to direction.

Options

Example

[ Download Example as Zipped Mathematica Notebook ]

Implementation Notes

See Also

PolygonIntersection



[ 10.06.2017 ]