export interface Point { x?: number; y?: number; amount?: number; angle?: number; } /** * distance between two point. */ export declare function getPointDistance(p1: Point, p2: Point): number; /** * Rotate point/vector around origin({x:0,y:0}). * @param {number} radian 弧度值,正为顺时针,负为逆时针. (在标准笛卡尔坐标系中,正度数指的是x正轴逆时针旋转,但我们的坐标系是上下颠倒的) */ export declare function rotatePoint(point: Point, radian: number): Point; export declare function rotatePointDeg(point: Point, degree: number): Point; /** * 计算出 以center为旋转中心,将point旋转radian度后的点 * @param radian {number} 是弧度值(带PI的),正为顺时针,负为逆时针 */ export declare function rotatePointAround(point: Point, center: Point, radian: number): Point; export declare function rotatePointAroundDeg(point: Point, center: Point, degree: number): Point; export declare function degree2Radian(degree: number): number; export declare function normalizeVector(vector: Point, len?: number): Point; export declare function diffPoint(from: Point, to: Point): Point; export declare function addPoint(pointA: Point, pointB: Point): Point; export declare function isEqualPoint(p1: Point, p2: Point): boolean; export declare function isPointLike(pos: any): boolean; /** * @description 判断某个点是否在多边形内部 * @param {point} point * @param {Array.} polygonPoints 多边形的构成点 * @return {boolean} * */ export declare function isPointInPolygon(point: Point, polygonPoints: Point[]): boolean; /** * @description 凸包算法 * @return {Point[]} * */ export declare function convexPointHull(pointList: Point[]): Point[]; export declare function Point(x: number, y: number): Point;