aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrahiel <rahiel@protonmail.ch>2015-10-19 20:50:01 +0200
committerrahiel <rahiel@protonmail.ch>2015-10-19 20:50:01 +0200
commitaf375243d20e5ddda55974233a37a335007dae31 (patch)
tree14144fefa5afb31f4b8206ab59b5a184d6536eb0
parent6c266bc767354509185bb6d8e560800c4c961728 (diff)
rename files and insert all periodic orbits from the paper
-rw-r--r--README.md2
-rw-r--r--calc.js (renamed from calc.es6.js)7
-rw-r--r--main.js (renamed from sunsistemo.es6.js)13
-rw-r--r--systems.js (renamed from systems.es6.js)21
-rw-r--r--webpack.config.js4
5 files changed, 30 insertions, 17 deletions
diff --git a/README.md b/README.md
index f41e01d..72ecc9c 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,8 @@ Hastings-Trew.
* The glow effect of the sun is from
[Three.js Examples](https://stemkoski.github.io/Three.js/Simple-Glow.html) by
Lee Stemkoski.
+* The initial conditions for the three-body planar periodic orbits are from
+[arXiv:1303.0181 **[physics.class-ph]**](http://arxiv.org/abs/1303.0181).
# License
diff --git a/calc.es6.js b/calc.js
index b49968a..ab35efc 100644
--- a/calc.es6.js
+++ b/calc.js
@@ -1,8 +1,7 @@
-// physical constants from http://physics.nist.gov/cuu/Constants/index.html
-export const G = 6.67408E-11;
-
let Vec3 = THREE.Vector3;
-import Body from "./systems.es6.js";
+import Body from "./systems.js";
+
+export const G = 6.67408E-11;
function accel(i, b) {
diff --git a/sunsistemo.es6.js b/main.js
index 51a1c98..b469db4 100644
--- a/sunsistemo.es6.js
+++ b/main.js
@@ -1,9 +1,9 @@
let scene, camera, light, renderer;
let controls, stats;
-import Body from "./systems.es6.js";
-import * as systems from "./systems.es6.js";
-import * as calc from "./calc.es6.js";
+import Body from "./systems.js";
+import * as systems from "./systems.js";
+import * as calc from "./calc.js";
let bodyTexture = true;
let numBodies = 1;
@@ -21,9 +21,10 @@ let menuList = [
{"label":"Random Bodies", "function": systems.genBodies, "args": [200, true, false]},
{"label":"Angular Momentum", "function": systems.genBodiesRot, "args": [200, "planets", true, false]},
{"label":"Angular with Bounce", "function": systems.genBodiesRot, "args": [200,"balls", true, true, true]},
- {"label":"Butterfly", "function": systems.genButterFlyOne, "args": []},
- {"label":"Yin Yang", "function": systems.genYinYang, "args": []},
- {"label":"Goggles", "function": systems.genYinYang, "args": []}
+ {"label":"Butterfly 1", "function": systems.genButterFly1, "args": []},
+ {"label":"Yin Yang 1", "function": systems.genYinYang1, "args": []},
+ {"label":"Goggles", "function": systems.genGoggles, "args": []},
+ {"label":"Yarn", "function": systems.genYarn, "args": []}
// {"label":"Solar System", "function": systems.genSolarSystem, "args": [true] }
];
gui(menuList);
diff --git a/systems.es6.js b/systems.js
index ad547a1..3b84773 100644
--- a/systems.es6.js
+++ b/systems.js
@@ -1,4 +1,4 @@
-import * as calc from "./calc.es6.js";
+import * as calc from "./calc.js";
let Vec3 = THREE.Vector3;
let textureSets = {
@@ -267,7 +267,7 @@ export function genBodiesRot(n, bodyTexture, sunOn, collisions) {
};
}
-function ThreeBodyPlanarPeriodicOrbit (x1d, y1d) {
+function ThreeBodyPlanarPeriodicOrbit(x1d, y1d) {
let f = () => {
let m = 1 / calc.G;
@@ -287,9 +287,20 @@ function ThreeBodyPlanarPeriodicOrbit (x1d, y1d) {
return f;
}
-export let genGoggles = ThreeBodyPlanarPeriodicOrbit(0.08330, 0.12789); // I.B.5 goggles
-export let genYinYang = ThreeBodyPlanarPeriodicOrbit(0.51394, 0.30474); // II.C.2a yin-yang I
-export let genButterFlyOne = ThreeBodyPlanarPeriodicOrbit(0.30689, 0.12551); // I.A.1 butterfly I
+// systems from http://arxiv.org/abs/1303.0181
+export let genButterFly1 = ThreeBodyPlanarPeriodicOrbit(0.30689, 0.12551);
+export let genButterFly2 = ThreeBodyPlanarPeriodicOrbit(0.39295, 0.09758);
+export let genBumblebee = ThreeBodyPlanarPeriodicOrbit(0.18428, 0.58719);
+export let genMoth1 = ThreeBodyPlanarPeriodicOrbit(0.46444, 0.39606);
+export let genMoth2 = ThreeBodyPlanarPeriodicOrbit(0.43917, 0.45297);
+export let genButterfly3 = ThreeBodyPlanarPeriodicOrbit(0.40592, 0.23016);
+export let genMoth3 = ThreeBodyPlanarPeriodicOrbit(0.38344, 0.37736);
+export let genGoggles = ThreeBodyPlanarPeriodicOrbit(0.08330, 0.12789);
+export let genButterfly4 = ThreeBodyPlanarPeriodicOrbit(0.350112, 0.07934);
+export let genDragonfly = ThreeBodyPlanarPeriodicOrbit(0.08058, 0.58884);
+export let genYarn = ThreeBodyPlanarPeriodicOrbit(0.55906, 0.34919);
+export let genYinYang1 = ThreeBodyPlanarPeriodicOrbit(0.51394, 0.30474);
+export let genYinYang2 = ThreeBodyPlanarPeriodicOrbit(0.41682, 0.33033);
function loadTextures(textureName, textOn, bumpOn, specOn){
diff --git a/webpack.config.js b/webpack.config.js
index 8bbb543..5c2ea4c 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,12 +1,12 @@
module.exports = {
- entry: "./sunsistemo.es6.js",
+ entry: "./main.js",
output: {
path: __dirname,
filename: "sunsistemo.js"
},
module: {
loaders: [
- { test: /\.es6\.js$/, exclude: /node_modules/, loader: "babel-loader"},
+ { test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"},
{ test: /\.css$/, loader: "style!css" }
]
}