UNPKG

@highcharts/dashboards

Version:
49 lines (48 loc) 1.75 kB
import type PositionObject from '../Renderer/PositionObject'; declare namespace GeometryUtilities { /** * Calculates the center between a list of points. * * @private * * @param {Array<Highcharts.PositionObject>} points * A list of points to calculate the center of. * * @return {Highcharts.PositionObject} * Calculated center */ function getCenterOfPoints(points: Array<PositionObject>): PositionObject; /** * Calculates the distance between two points based on their x and y * coordinates. * * @private * * @param {Highcharts.PositionObject} p1 * The x and y coordinates of the first point. * * @param {Highcharts.PositionObject} p2 * The x and y coordinates of the second point. * * @return {number} * Returns the distance between the points. */ function getDistanceBetweenPoints(p1: PositionObject, p2: PositionObject): number; /** * Calculates the angle between two points. * @todo add unit tests. * @private * @param {Highcharts.PositionObject} p1 The first point. * @param {Highcharts.PositionObject} p2 The second point. * @return {number} Returns the angle in radians. */ function getAngleBetweenPoints(p1: PositionObject, p2: PositionObject): number; /** * Test for point in polygon. Polygon defined as array of [x,y] points. * @private * @param {PositionObject} point The point potentially within a polygon. * @param {Array<Array<number>>} polygon The polygon potentially containing the point. */ function pointInPolygon({ x, y }: PositionObject, polygon: Array<Array<number>>): boolean; } export default GeometryUtilities;