diff --git a/project.json b/project.json index 30f7839..cff5c2d 100644 --- a/project.json +++ b/project.json @@ -1,6 +1,6 @@ { "display_name": "Pendulum", - "info_text": "Watch 500 Double-Pendulums diverge into chaos", + "info_text": "The laboratory for n-Pendula simulations, using 'Position Based Dynamics'.", "visible": true, "tags": ["Simulation"] } \ No newline at end of file diff --git a/public/data/scripts/ts/pendulum.ts b/public/data/scripts/ts/pendulum.ts index 0b838be..70db53b 100644 --- a/public/data/scripts/ts/pendulum.ts +++ b/public/data/scripts/ts/pendulum.ts @@ -86,10 +86,11 @@ class Pendulum { p1 = p2.copy(); } - for (let p2 of this.X){ - p2 = p2.copy(); + for (let i = 0; i < this.size; i++){ + let p2 = this.X[i].copy(); p2.mult(scale); - p.ellipse(p2.x, p2.y, 10, 10); + let r = Math.sqrt(this.M[i] * 10); + p.ellipse(p2.x, p2.y, r * 2, r * 2); } p.pop(); diff --git a/public/index.html b/public/index.html index 36e5ee0..505b623 100644 --- a/public/index.html +++ b/public/index.html @@ -4,7 +4,7 @@ - + diff --git a/public/thumbnail.png b/public/thumbnail.png index 84ed71b..b55b793 100644 Binary files a/public/thumbnail.png and b/public/thumbnail.png differ