export interface Point { x: number y: number, dx?: number dy?: number } function distance (a: Point, b: Point): number { const x = b.x - a.x; const y = b.y - a.y; return Math.sqrt(x * x + y * y); } export { distance }