6 lines
164 B
JavaScript
Raw Normal View History

2026-05-31 13:21:13 +02:00
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));
}