Post

TIL: JavaScript (basically) has a built-in coordinate distance function. const distance = Math.hypot(x2 - x1, y2 - y1) Also works for 3+ dimensions (just add more params).

No replies yet.