export interface IPoint { x: number y: number } /** * 2 point distance * @param p1 * @param p2 * @return {number} */ export function get2PointDistance(p1: IPoint, p2: IPoint) { let s = Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2) return Math.sqrt(s) }