export function lineLength(line) { const p1 = line[0]; const p2 = line[1]; return Math.sqrt(Math.pow(p1[0] - p2[0], 2) + Math.pow(p1[1] - p2[1], 2)); }