From 20864a343e7c0117607283438918da6d73ffaa6c Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 20:46:42 +0000 Subject: [PATCH 1/3] Initial plan From 000dfb24400c6727f93d2141130a4432aee1badf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 Aug 2025 20:58:00 +0000 Subject: [PATCH 2/3] Implement Three Body Problem setup with 3 suns and 3 planets Co-authored-by: GrantErickson <5058658+GrantErickson@users.noreply.github.com> --- models/threeBody.ts | 92 +++++++++++++++++++++++++++++++++++++++++++++ pages/index.vue | 2 + 2 files changed, 94 insertions(+) create mode 100644 models/threeBody.ts diff --git a/models/threeBody.ts b/models/threeBody.ts new file mode 100644 index 0000000..c26a06d --- /dev/null +++ b/models/threeBody.ts @@ -0,0 +1,92 @@ +import Body from "~/models/body"; +import Vector from "~/models/vector"; +import { Setup } from "~/models/setup"; + +export default class ThreeBody extends Setup { + title = "Three Body Problem"; + + bodies(): Body[] { + let result: Body[] = []; + + // Three suns positioned in a roughly triangular configuration + // Based on the Three Body Problem novels - three suns of similar mass creating chaotic system + const sunMass = 1.989e30; // Solar mass + const sunRadius = 6.96e8; // Solar radius + const baseDistance = 1.5e11; // 1 AU for separation + + // Sun 1 - positioned at origin initially + result.push( + new Body( + "Alpha Centauri A", + new Vector(0, 0, 0), + new Vector(5000, 8000, 0), + sunMass, + sunRadius, + 0xFFDD44 // Yellow sun + ) + ); + + // Sun 2 - positioned to the right + result.push( + new Body( + "Alpha Centauri B", + new Vector(baseDistance * 1.2, 0, 0), + new Vector(-2500, 6000, 0), + sunMass * 0.9, // Slightly smaller + sunRadius * 0.9, + 0xFF6644 // Orange sun + ) + ); + + // Sun 3 - positioned to form triangle + result.push( + new Body( + "Proxima Centauri", + new Vector(baseDistance * 0.6, baseDistance * 0.8, 0), + new Vector(-3000, -7000, 0), + sunMass * 0.8, // Smaller red dwarf + sunRadius * 0.7, + 0xFF4444 // Red sun + ) + ); + + // Three planets at different distances showing chaotic orbital behavior + // Planet 1 - Trisolaris (the main planet from the novels) + result.push( + new Body( + "Trisolaris", + new Vector(baseDistance * 2.1, baseDistance * 0.3, 0), + new Vector(-8000, 12000, 0), + 5.97219e24, // Earth mass + 6.378e6, // Earth radius + 0x4488FF // Blue planet + ) + ); + + // Planet 2 - Inner chaotic planet + result.push( + new Body( + "Chaotic Inner", + new Vector(baseDistance * 0.9, -baseDistance * 1.1, 0), + new Vector(15000, 5000, 0), + 3.97219e24, // Smaller than Earth + 5.378e6, + 0x44FF88 // Green planet + ) + ); + + // Planet 3 - Outer planet with more stable but still chaotic orbit + result.push( + new Body( + "Distant World", + new Vector(-baseDistance * 2.8, baseDistance * 1.2, 0), + new Vector(4000, -6000, 0), + 7.97219e24, // Larger than Earth + 7.378e6, + 0xFF8844 // Orange planet + ) + ); + + return result; + } +} \ No newline at end of file diff --git a/pages/index.vue b/pages/index.vue index 83f5510..0601785 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -188,6 +188,7 @@ import EarthMoonAndOthers from "~/models/earthMoonAndOthers"; import EarthMoon from "~/models/earthMoon"; import Chaos from "~/models/chaos"; import Binary from "~/models/binary"; +import ThreeBody from "~/models/threeBody"; import Vector from "~/models/vector"; // Type definitions @@ -595,6 +596,7 @@ onMounted(() => { setups.value.push(new EarthMoonAndOthers()); setups.value.push(new Chaos()); setups.value.push(new Binary()); + setups.value.push(new ThreeBody()); if (process.client) { const storedSetup = localStorage.getItem("selectedSetup") || ""; From 25f4034f7b1bd1fa4439c8a1876132fdb79a82b7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 Aug 2025 22:41:38 +0000 Subject: [PATCH 3/3] Scale Three Body Problem setup 100x smaller with appropriate velocity adjustments Co-authored-by: GrantErickson <5058658+GrantErickson@users.noreply.github.com> --- models/threeBody.ts | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/models/threeBody.ts b/models/threeBody.ts index c26a06d..6845e7e 100644 --- a/models/threeBody.ts +++ b/models/threeBody.ts @@ -10,16 +10,17 @@ export default class ThreeBody extends Setup { // Three suns positioned in a roughly triangular configuration // Based on the Three Body Problem novels - three suns of similar mass creating chaotic system - const sunMass = 1.989e30; // Solar mass - const sunRadius = 6.96e8; // Solar radius - const baseDistance = 1.5e11; // 1 AU for separation + // Scaled down by 100x for closer observation + const sunMass = 1.989e30; // Solar mass (kept same for realistic physics) + const sunRadius = 6.96e6; // Solar radius scaled down 100x + const baseDistance = 1.5e9; // 1/100 AU for separation (scaled down 100x) // Sun 1 - positioned at origin initially result.push( new Body( "Alpha Centauri A", new Vector(0, 0, 0), - new Vector(5000, 8000, 0), + new Vector(500, 800, 0), // Velocities scaled down by 10x sunMass, sunRadius, 0xFFDD44 // Yellow sun @@ -31,7 +32,7 @@ export default class ThreeBody extends Setup { new Body( "Alpha Centauri B", new Vector(baseDistance * 1.2, 0, 0), - new Vector(-2500, 6000, 0), + new Vector(-250, 600, 0), // Velocities scaled down by 10x sunMass * 0.9, // Slightly smaller sunRadius * 0.9, 0xFF6644 // Orange sun @@ -43,7 +44,7 @@ export default class ThreeBody extends Setup { new Body( "Proxima Centauri", new Vector(baseDistance * 0.6, baseDistance * 0.8, 0), - new Vector(-3000, -7000, 0), + new Vector(-300, -700, 0), // Velocities scaled down by 10x sunMass * 0.8, // Smaller red dwarf sunRadius * 0.7, 0xFF4444 // Red sun @@ -56,9 +57,9 @@ export default class ThreeBody extends Setup { new Body( "Trisolaris", new Vector(baseDistance * 2.1, baseDistance * 0.3, 0), - new Vector(-8000, 12000, 0), + new Vector(-800, 1200, 0), // Velocities scaled down by 10x 5.97219e24, // Earth mass - 6.378e6, // Earth radius + 6.378e4, // Earth radius scaled down 100x 0x4488FF // Blue planet ) ); @@ -68,9 +69,9 @@ export default class ThreeBody extends Setup { new Body( "Chaotic Inner", new Vector(baseDistance * 0.9, -baseDistance * 1.1, 0), - new Vector(15000, 5000, 0), + new Vector(1500, 500, 0), // Velocities scaled down by 10x 3.97219e24, // Smaller than Earth - 5.378e6, + 5.378e4, // Radius scaled down 100x 0x44FF88 // Green planet ) ); @@ -80,9 +81,9 @@ export default class ThreeBody extends Setup { new Body( "Distant World", new Vector(-baseDistance * 2.8, baseDistance * 1.2, 0), - new Vector(4000, -6000, 0), + new Vector(400, -600, 0), // Velocities scaled down by 10x 7.97219e24, // Larger than Earth - 7.378e6, + 7.378e4, // Radius scaled down 100x 0xFF8844 // Orange planet ) );