diff options
Diffstat (limited to 'docs/assets/n-body/script.js')
-rw-r--r-- | docs/assets/n-body/script.js | 4 |
1 files changed, 3 insertions, 1 deletions
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; |