{"id":1153,"date":"2024-03-30T16:53:15","date_gmt":"2024-03-30T15:53:15","guid":{"rendered":"https:\/\/thetallguy.fr\/?page_id=1153"},"modified":"2024-03-30T16:54:08","modified_gmt":"2024-03-30T15:54:08","slug":"the-3-body-problem","status":"publish","type":"page","link":"https:\/\/thetallguy.fr\/index.php\/astronomie\/the-3-body-problem\/","title":{"rendered":"The 3 body problem"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">The three-body problem is a famous issue in celestial mechanics involving determining the motion of three celestial bodies under the mutual influence of their gravitational forces. In other terms, it's about predicting the trajectories of three objects, such as planets or stars, based on their positions, initial velocities, and the laws of Newtonian gravitation.\n\nThis problem is considered unsolved in a general sense because there is no simple analytical solution (i.e., an explicit mathematical formula) for all possible initial conditions of the three bodies. Existing specific solutions, such as Lagrange points, are special cases that apply under very specific conditions. For most situations, solutions must be approximated through numerical methods that involve using computers to simulate the trajectories over periods.\n\nThe lack of a general analytical solution is due to the complex and nonlinear nature of the gravitational interactions among the three bodies, which can lead to extremely sensitive dynamic behaviors to initial conditions, a phenomenon often associated with chaos theory.<\/pre>\n\n\n<p><!DOCTYPE html><br \/>\n<html lang=\"fr\"><br \/>\n<head><br \/>\n    <meta charset=\"UTF-8\"><br \/>\n    <title>Simulation \u00e0 Trois Corps<\/title><\/p>\n<style>\n        canvas {\n            background-color: #000;\n        }\n    <\/style>\n<p><\/head><br \/>\n<body><br \/>\n<canvas id=\"simulationCanvas\" width=\"800\" height=\"800\"><\/canvas><br \/>\n<script>\n    const canvas = document.getElementById('simulationCanvas');\n    const ctx = canvas.getContext('2d');\n    const G = 0.01; \/\/ Constante gravitationnelle ajust\u00e9e pour cette d\u00e9mo\n    const centerAttraction = 0.005; \/\/ Force de convergence vers le centre\n    const bodies = [\n        { x: 300, y: 400, vx: 0.1, vy: -0.2, mass: 10, radius: 100 },\n        { x: 500, y: 400, vx: -0.1, vy: 0.2, mass: 5, radius: 50 },\n        { x: 400, y: 500, vx: 0.2, vy: -0.1, mass: 2.5, radius: 25 }\n    ];<\/p>\n<p>    const centerX = canvas.width \/ 2;\n    const centerY = canvas.height \/ 2;<\/p>\n<p>    function updateForces() {\n        let forces = bodies.map(() => ({ x: 0, y: 0 }));<\/p>\n<p>        \/\/ Force de convergence vers le centre pour chaque corps\n        bodies.forEach((body, index) => {\n            const dx = centerX - body.x;\n            const dy = centerY - body.y;\n            const dist = Math.sqrt(dx * dx + dy * dy);\n            const forceMagnitude = centerAttraction * body.mass;\n            const forceX = forceMagnitude * dx \/ dist;\n            const forceY = forceMagnitude * dy \/ dist;<\/p>\n<p>            forces[index].x += forceX;\n            forces[index].y += forceY;\n        });<\/p>\n<p>        \/\/ Forces gravitationnelles mutuelles\n        for (let i = 0; i < bodies.length; i++) {\n            for (let j = i + 1; j < bodies.length; j++) {\n                const dx = bodies[j].x - bodies[i].x;\n                const dy = bodies[j].y - bodies[i].y;\n                const dist = Math.sqrt(dx * dx + dy * dy);\n                const forceMagnitude = G * bodies[i].mass * bodies[j].mass \/ (dist * dist);\n                const forceX = forceMagnitude * dx \/ dist;\n                const forceY = forceMagnitude * dy \/ dist;\n\n                forces[i].x += forceX;\n                forces[i].y += forceY;\n                forces[j].x -= forceX;\n                forces[j].y -= forceY;\n            }\n        }\n\n        for (let i = 0; i < bodies.length; i++) {\n            bodies[i].vx += forces[i].x \/ bodies[i].mass;\n            bodies[i].vy += forces[i].y \/ bodies[i].mass;\n        }\n    }\n\n    function updatePositions() {\n        bodies.forEach(body => {\n            body.x += body.vx;\n            body.y += body.vy;\n        });\n    }<\/p>\n<p>    function drawBodies() {\n        ctx.clearRect(0, 0, canvas.width, canvas.height);\n        bodies.forEach(body => {\n            ctx.beginPath();\n            ctx.arc(body.x, body.y, body.radius, 0, 2 * Math.PI);\n            ctx.strokeStyle = 'white';\n            ctx.stroke();\n        });\n    }<\/p>\n<p>    function update() {\n        updateForces();\n        updatePositions();\n        drawBodies();\n        requestAnimationFrame(update);\n    }<\/p>\n<p>    update();\n<\/script><br \/>\n<\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The three-body problem is a famous issue in celestial mechanics involving determining the motion of three celestial bodies under the mutual influence of their gravitational forces. In other terms, it&#8217;s about predicting the trajectories of three objects, such as planets or stars, based on their positions, initial velocities, and the laws of Newtonian gravitation. This [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":369,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-basique-the-tall-guy","meta":{"footnotes":""},"class_list":["post-1153","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/pages\/1153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/comments?post=1153"}],"version-history":[{"count":1,"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/pages\/1153\/revisions"}],"predecessor-version":[{"id":1154,"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/pages\/1153\/revisions\/1154"}],"up":[{"embeddable":true,"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/pages\/369"}],"wp:attachment":[{"href":"https:\/\/thetallguy.fr\/index.php\/wp-json\/wp\/v2\/media?parent=1153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}