diff options
author | navanchauhan <navanchauhan@gmail.com> | 2023-05-01 13:13:26 -0600 |
---|---|---|
committer | navanchauhan <navanchauhan@gmail.com> | 2023-05-01 13:13:26 -0600 |
commit | 11e531eaa4e6c348706096dc272b8a9d3ab45938 (patch) | |
tree | fd24f886caac1e190af8ce0928f006b4d2a2b35f /Resources/assets/n-body | |
parent | 3d902334815db764d0cb6e4bbf6c553ff1fd6f2e (diff) |
re-add 3body sim
Diffstat (limited to 'Resources/assets/n-body')
-rw-r--r-- | Resources/assets/n-body/script.js | 4 |
1 files changed, 3 insertions, 1 deletions
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; |