From a5de1df6c7e9124d67c808b1d85c364de9b437f7 Mon Sep 17 00:00:00 2001 From: Kent Rasmussen Date: Sun, 25 May 2025 14:48:24 +0900 Subject: [PATCH] switch to Math.sqrt from Math.hypot --- js/common_functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/common_functions.js b/js/common_functions.js index f1d4e14..a2a2e1d 100644 --- a/js/common_functions.js +++ b/js/common_functions.js @@ -645,7 +645,7 @@ function distance(a, b) { const dx = Math.max(bLeft - aRight, aLeft - bRight, 0); const dy = Math.max(bTop - aBottom, aTop - bBottom, 0); - return Math.hypot(dx, dy); + return Math.sqrt(dx * dx + dy * dy); } function random_away(x,y,R) // https://stackoverflow.com/a/5838055/914546