Skip to content

An interactive 3D visualization of the three-body problem using Three.js. This simulator allows users to explore the chaotic and unpredictable behavior of a gravitational system with three bodies.

License

Notifications You must be signed in to change notification settings

shhawkins/three-body-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Three Body Problem Simulator

An interactive 3D visualization of the three-body problem using Three.js. This simulator allows users to explore the chaotic and unpredictable behavior of a gravitational system with three bodies.

Features

  • Real-time 3D simulation of gravitational interactions
  • Interactive controls to adjust mass, velocity, and initial positions
  • Camera controls for exploring the simulation from any angle
  • Cinematic mode for dynamic viewing
  • Mobile-responsive design with touch support
  • Ability to adjust bodies during simulation

Technologies

  • Three.js for 3D rendering
  • HTML5 and CSS3
  • JavaScript ES6
  • Responsive design for various device sizes

Usage

  1. Open index.html in a web browser
  2. Use the control panels to adjust simulation parameter
  3. Try starting with the default parameters for a stable orbit,then make a small change while the bodies are moving. Speed up time for a chaotic dance
  4. Click the "Toggle Borderless" button for more space to play
  5. Toggle UI visibility with the "Hide UI" button
  6. Enable "Cinematic Mode" for dynamic viewing and camera cuts

Controls

  • Mass Controls: Adjust the mass of each body
  • Velocity Controls: Adjust the velocity of each body
  • Position Controls: Adjust the positions of each body
  • Camera Controls: Rotate, and zoom to explore the simulation
  • Preset Camera Views: Choose from several preset viewpoints
  • Speed Controls: Adjust simulation speed and time step
  • Reset: Return to initial conditions or preset configurations

Development

To extend this project:

  1. Fork the repository
  2. Make changes to the HTML, CSS, or JavaScript code
  3. Test in a local browser
  4. Submit pull requests for improvements

License

MIT License

Copyright (c) 2024 Sam Hawkins

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Credits

Created by Sam Hawkins

About

An interactive 3D visualization of the three-body problem using Three.js. This simulator allows users to explore the chaotic and unpredictable behavior of a gravitational system with three bodies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages