import * as geom from './index'; import type { Line } from './Line'; import type { Matrix } from './Matrix'; import type { Segment } from './Segment'; import { Shape } from './Shape'; export type PointLike = { x: number; y: number; }; /** * Class representing a point */ export declare class Point extends Shape { static EMPTY: Readonly; /** x-coordinate (float number) */ x: number; /** y-coordinate (float number) */ y: number; constructor(); constructor(x: number, y: number); constructor(other: PointLike); constructor(other: [number, number]); /** * Return new cloned instance of point */ clone(): geom.Point; get tag(): geom.ShapeTag; get name(): string; /** * Returns bounding box of a point */ get box(): geom.Box; get center(): this; isEmpty(): boolean; get vertices(): this[]; contains(other: Point): boolean; /** * Returns true if points are equal up to [Utils.DP_TOL]{@link DP_TOL} tolerance */ equalTo(pt: Point): boolean; /** * Defines predicate "less than" between points. Returns true if the point is less than query points, false otherwise
* By definition point1 < point2 if {point1.y < point2.y || point1.y == point2.y && point1.x < point2.x
* Numeric values compared with [Utils.DP_TOL]{@link DP_TOL} tolerance */ lessThan(pt: Point): boolean; /** * Return new point transformed by affine transformation matrix */ transform(m: Matrix): geom.Point; /** * Returns projection point on given line */ projectionOn(line: Line): geom.Point; /** * Returns true if point belongs to the "left" semi-plane, which means, point belongs to the same semi plane where line normal vector points to * Return false if point belongs to the "right" semi-plane or to the line itself */ leftTo(line: Line): boolean; /** * Snap the point to a grid. */ snapToGrid(grid: number): Point; snapToGrid(xGrid: number, yGrid: number): Point; /** * Calculate distance and shortest segment from point to shape and return as array [distance, shortest segment] * @param shape Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set * @returns distance from point to shape * @returns shortest segment between point and shape (started at point, ended at shape) */ distanceTo(shape: Shape): [number, Segment]; /** * Returns true if point is on a shape, false otherwise * @param shape - Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon */ on(shape: Shape): boolean; } export declare const point: (a: any, b: any) => geom.Point; //# sourceMappingURL=Point.d.ts.map