From f6c294b812e51bcc26d2e4c1551c88a1215546b3 Mon Sep 17 00:00:00 2001 From: Minh Date: Tue, 17 Oct 2023 23:56:17 +0900 Subject: [PATCH 1/2] Fixed black hole calculation error at t=1 --- theory.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/theory.js b/theory.js index 27980a3..b068035 100644 --- a/theory.js +++ b/theory.js @@ -120,8 +120,8 @@ const scale = 4; const derivRes = 100000; -const resolution = 4; -const getBlackholeSpeed = (z) => Math.min(z**2 + 0.004, 1/resolution); +const resolution = 1/4; +const getBlackholeSpeed = (z) => Math.min(z**2 + 0.004, resolution); const c1ExpMaxLevel = 3; // The first 3 zeta zeroes lol @@ -503,7 +503,8 @@ let zetaSmall = (t) => let offset = fullIndex - index; let re = zeta01Table[index][0]*(1-offset) + zeta01Table[index+1][0]*offset; let im = zeta01Table[index][1]*(1-offset) + zeta01Table[index+1][1]*offset; - return [re, im, Math.sqrt(re*re + im*im)]; + return [re, im, -Math.sqrt(re*re + im*im)]; + // Minus sign for the last element because of theta polarity } let even = (n) => @@ -706,7 +707,7 @@ let zeta = (T) => z = [ a[0]*(1-offset) + b[0]*offset, a[1]*(1-offset) + b[1]*offset, - a[2]*(1-offset) + Math.abs(b[2])*offset + a[2]*(1-offset) + b[2]*offset ]; } if(T < 0) @@ -947,7 +948,7 @@ var init = () => foundZero = false; bhzTerm = null; bhdTerm = null; - if(lastZero) + if(lastZero >= 14) t = lastZero; } blackholeMs.refunded = (_) => @@ -989,7 +990,7 @@ var tick = (elapsedTime, multiplier) => pubTime += elapsedTime; if(!blackholeMs.level || t < 14) { - t_dot = 1 / resolution; + t_dot = resolution; t += t_dot * elapsedTime; } @@ -1024,7 +1025,7 @@ var tick = (elapsedTime, multiplier) => // Not very accurate this way but eh (xdd) if(searchingRewind && bhdt < 0) { - t_dot = 1 / resolution; + t_dot = resolution; t += t_dot * elapsedTime; } else @@ -1250,6 +1251,8 @@ var postPublish = () => lastZero = 0; searchingRewind = false; foundZero = false; + bhzTerm = null; + bhdTerm = null; theory.invalidatePrimaryEquation(); theory.invalidateSecondaryEquation(); From 12e855843ef01c765a15c13c4d405182d107dbb1 Mon Sep 17 00:00:00 2001 From: Minh Date: Tue, 17 Oct 2023 23:56:40 +0900 Subject: [PATCH 2/2] Prepared for 0.4.1 --- theory.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theory.js b/theory.js index b068035..9e22ff3 100644 --- a/theory.js +++ b/theory.js @@ -90,9 +90,9 @@ var authors = 'propfeds, Eylanding\nMartin_mc, previous maintainer\n\n' + 'for teaching the ancient Sim language\nSneaky, Gen & Gaunter, for maths ' + 'consultation & other suggestions\n\nTranslations:\nOmega_3301 - 简体中文、' + '繁體中文\nJooo#0529 - Español\npropfeds - Tiếng Việt'; -var version = 0.4; +var version = 0.41; -const versionName = 'v0.4'; +const versionName = 'v0.4.1'; const workInProgress = false; let terms = 0;