From 11e531eaa4e6c348706096dc272b8a9d3ab45938 Mon Sep 17 00:00:00 2001 From: navanchauhan Date: Mon, 1 May 2023 13:13:26 -0600 Subject: re-add 3body sim --- docs/assets/n-body/script.js | 4 +++- docs/feed.rss | 9 +++++++-- docs/posts/2023-04-30-n-body-simulation.html | 5 +++++ 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/assets/n-body/script.js b/docs/assets/n-body/script.js index 6042e27..cd8b8b0 100644 --- a/docs/assets/n-body/script.js +++ b/docs/assets/n-body/script.js @@ -290,7 +290,9 @@ function initCondGen(nBodies, vRange = [-7e3, 7e3], posRange = [-35, 35]) { } function random3BodySimSolver(tStop, nTPts, nBodiesStop=2, G=6.674e-11) { - let initConditions = initCondGen(3,[-7e3, 7e3],[-5, 5]); + let userInputPositionValue = parseInt(document.getElementById("distanceAU").value); + let userInputVelocityValue = Number(document.getElementById("vRange").value); + let initConditions = initCondGen(3,[-userInputVelocityValue, userInputVelocityValue],[-userInputPositionValue, userInputPositionValue]); let myMasses = initConditions.m; let myCoords = initConditions.coords; diff --git a/docs/feed.rss b/docs/feed.rss index 23f6a2f..c85bde3 100644 --- a/docs/feed.rss +++ b/docs/feed.rss @@ -4,8 +4,8 @@ Navan's Archive Rare Tips, Tricks and Posts https://web.navan.dev/en - Mon, 01 May 2023 12:58:21 -0000 - Mon, 01 May 2023 12:58:21 -0000 + Mon, 01 May 2023 13:13:07 -0000 + Mon, 01 May 2023 13:13:07 -0000 250 @@ -4783,6 +4783,11 @@ The simulations require JavaScript to be viewed properly :( + + +