UNPKG

@avdl/martinez

Version:

TypeScript library for polygon boolean operations

27 lines 1.35 kB
import type { Point, Segment } from '../types'; /** * Calculate the signed area of a triangle formed by three points * @param firstPoint First point of the triangle * @param secondPoint Second point of the triangle * @param thirdPoint Third point of the triangle * @returns Signed area (positive for counter-clockwise, negative for clockwise) */ export declare function calculateSignedArea(firstPoint: Point, secondPoint: Point, thirdPoint: Point): number; /** * Find intersection between two line segments * @param segment1 First line segment * @param segment2 Second line segment * @param intersectionPoint1 Output: first intersection point * @param intersectionPoint2 Output: second intersection point (for overlapping segments) * @returns Number of intersections (0, 1, or 2) */ export declare function findSegmentIntersection(segment1: Segment, segment2: Segment, intersectionPoint1: Point, intersectionPoint2: Point): number; /** * Check if a point lies on a line segment * @param segmentStart Start point of the segment * @param segmentEnd End point of the segment * @param testPoint Point to test * @returns True if the point lies on the segment */ export declare function isPointOnSegment(segmentStart: Point, segmentEnd: Point, testPoint: Point): boolean; //# sourceMappingURL=geometry-utils.d.ts.map