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 --- Resources/assets/n-body/script.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Resources') diff --git a/Resources/assets/n-body/script.js b/Resources/assets/n-body/script.js index 6042e27..cd8b8b0 100644 --- a/Resources/assets/n-body/script.js +++ b/Resources/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; -- cgit v1.2.3