@technobuddha/library
Version:
A large library of useful functions
15 lines (14 loc) • 674 B
TypeScript
import { type Cartesian, type LineSegment } from './@types/geometry.ts';
/**
* Determines whether a given point lies on a specified line segment within a certain tolerance.
*
* @param point - The Cartesian coordinates of the point to check.
* @param line - The line segment defined by its endpoints.
* @param epsilon - Optional tolerance for floating-point comparisons (default is 1e-10).
* @returns `true` if the point lies on the line segment within the given tolerance, otherwise `false`.
*
* @group Geometry
* @category Line Segment
* @category Point
*/
export declare function isOnLineSegment(point: Cartesian, line: LineSegment, epsilon?: number): boolean;