intersectUnboundedLine Method

Intersect this ray with the unbounded line defined by the given points.

intersectUnboundedLine(linePointA: Point2d, linePointB: Point2d): { cross: number, fraction: number, hasIntersection: boolean }

@returns object with named values:

  • hasIntersection: whether the intersection exists.
  • fraction: ray parameter of intersection, or 0.0 if !hasIntersection. If the instance is normalized, this is the signed distance along the ray to the intersection point.
  • cross: the 2D cross product this.direction x (linePointB - linePointA), useful for determining orientation of the line and ray.
Parameter Type Description
linePointA Point2d start of the line
linePointB Point2d end of the line

Returns - { cross: number, fraction: number, hasIntersection: boolean }

object with named values:

  • hasIntersection: whether the intersection exists.
  • fraction: ray parameter of intersection, or 0.0 if !hasIntersection. If the instance is normalized, this is the signed distance along the ray to the intersection point.
  • cross: the 2D cross product this.direction x (linePointB - linePointA), useful for determining orientation of the line and ray.

Defined in

Last Updated: 14 November, 2024