lineSegmentXYUVIntersectionUnbounded MethodStatic

Intersect two transverse or overlapping unbounded 2D line segments.

lineSegmentXYUVIntersectionUnbounded(a0: XAndY, aDir: XAndY, b0: XAndY, bDir: XAndY, tol: number = Geometry.smallMetricDistance): { f0: WritableXAndY, f1?: WritableXAndY } | undefined

@returns intersection fractions:

  • If f1 is undefined, the intersection occurs at fraction f0.x along line A and f0.y along line B.
  • If f1 is defined, the line segments are parallel and overlap: segment B maps to fractions in the range f0.x < f1.x on line A; segment A maps to fractions in the range f0.y < f1.y on line B.
  • If undefined, the lines are parallel without overlap.
Parameter Type Description
a0 XAndY start point of line A
aDir XAndY direction vector of line A; end point of line segment A is a0 + aDir
b0 XAndY start point of line B
bDir XAndY direction vector of line B; end point of line segment B is b0 + bDir
tol number overlap distance tolerance

Returns - { f0: WritableXAndY, f1?: WritableXAndY } | undefined

intersection fractions:

  • If f1 is undefined, the intersection occurs at fraction f0.x along line A and f0.y along line B.
  • If f1 is defined, the line segments are parallel and overlap: segment B maps to fractions in the range f0.x < f1.x on line A; segment A maps to fractions in the range f0.y < f1.y on line B.
  • If undefined, the lines are parallel without overlap.

Defined in

Last Updated: 04 June, 2026