@technobuddha/library
Version: 
A large library of useful functions
15 lines (14 loc) • 668 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 test.
 * @param line - The line segment, defined by its endpoints.
 * @param epsilon - Optional tolerance for floating-point comparison (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 isWithLine(point: Cartesian, line: LineSegment, epsilon?: number): boolean;