summaryrefslogtreecommitdiff
path: root/docs/assets/n-body
diff options
context:
space:
mode:
authornavanchauhan <navanchauhan@gmail.com>2023-05-01 13:13:26 -0600
committernavanchauhan <navanchauhan@gmail.com>2023-05-01 13:13:26 -0600
commit11e531eaa4e6c348706096dc272b8a9d3ab45938 (patch)
treefd24f886caac1e190af8ce0928f006b4d2a2b35f /docs/assets/n-body
parent3d902334815db764d0cb6e4bbf6c553ff1fd6f2e (diff)
re-add 3body sim
Diffstat (limited to 'docs/assets/n-body')
-rw-r--r--docs/assets/n-body/script.js4
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;