From 196c3d8f8e0b8c96cfdb20d5d813891e13f1b3a7 Mon Sep 17 00:00:00 2001 From: "Laetitia (O-01-67)" <68935009+O-01-67@users.noreply.github.com> Date: Mon, 20 Feb 2023 15:04:48 -0500 Subject: [PATCH] new function --- mods/code_library.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/code_library.js b/mods/code_library.js index 54b910e7..24f3f229 100644 --- a/mods/code_library.js +++ b/mods/code_library.js @@ -225,6 +225,11 @@ //Math(s) + //Base n logarithm from https://stackoverflow.com/a/3019290 + function logN(number,base) { //Vulnerable to float issues + return Math.log(number) / Math.log(base); + }; + //Distance between points function pyth(xA,yA,xB,yB) { var a = Math.abs(xB - xA);