import { pointFrom } from "./point"; import { lineSegment, lineSegmentIntersectionPoints } from "./segment"; import type { GlobalPoint, LineSegment, LocalPoint, Rectangle } from "./types"; export function rectangle
( topLeft: P, bottomRight: P, ): Rectangle
{ return [topLeft, bottomRight] as Rectangle
;
}
export function rectangleIntersectLineSegment<
Point extends LocalPoint | GlobalPoint,
>(r: Rectangle