Skip to content

Commit

Permalink
Merge pull request #2437 from JPMeehan/2244-Geometry
Browse files Browse the repository at this point in the history
Geometry
  • Loading branch information
LukeAbby committed Nov 14, 2023
2 parents 502652d + e10bb0d commit b793834
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/foundry/common/utils/geometry.mjs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,33 @@ interface LineIntersection {
t1?: number;
}

interface LineIntersectionOptions {
/**
* Return the optional vector distance from C to D on CD
* @defaultValue `false`
*/
t1?: boolean;
}

/**
* An internal helper method for computing the intersection between two infinite-length lines.
* Adapted from http://paulbourke.net/geometry/pointlineplane/
*
* @param a - The first endpoint of segment AB
* @param b - The second endpoint of segment AB
* @param c - The first endpoint of segment CD
* @param d - The second endpoint of segment CD
* @param a - The first endpoint of segment AB
* @param b - The second endpoint of segment AB
* @param c - The first endpoint of segment CD
* @param d - The second endpoint of segment CD
* @param options - Options which affect the intersection test
*
* @returns An intersection point, or null if no intersection occurred
*/
export function lineLineIntersection(a: Point, b: Point, c: Point, d: Point): LineIntersection | null;
export function lineLineIntersection(
a: Point,
b: Point,
c: Point,
d: Point,
options: LineIntersectionOptions,
): LineIntersection | null;

/**
* An internal helper method for computing the intersection between two finite line segments.
Expand Down

0 comments on commit b793834

Please sign in to comment.