Find the intersections between a line segment and a circle.

function intersectLineSegmentCircle(
  a1: VecLike,
  a2: VecLike,
  c: VecLike,
  r: number
): null | VecLike[]
Parameters
NameDescription

a1

VecLike

The segment's first point.

a2

VecLike

The segment's second point.

c

VecLike

The circle's center.

r

number

The circle's radius.

Returns
null | VecLike[]
intersectCirclePolylineintersectLineSegmentLineSegment