Skip to content

Commit

Permalink
Geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
JPMeehan committed Nov 13, 2023
1 parent bdbbd1a commit e10bb0d
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 e10bb0d

Please sign in to comment.