A 2D gravity simulation built in Java using Swing. Create celestial bodies, control their mass and velocity, and watch them interact with real-time Newtonian physics.
- ๐ฑ Click to add new planets with custom mass and velocity
- ๐ Sliders for adjusting mass and initial velocity
- โฏ Pause/Resume simulation
- ๐ Zoom and pan controls (mouse wheel & drag)
- ๐งญ Toggle coordinates and velocity display
- Java 8 or higher
- IntelliJ IDEA (or any IDE)
- Clone the repository:
git clone https://github.com/NamanRajput-git/Akira_GravitySim.git cd akira_GravitySim
Open in IntelliJ:
-
File โ Open โ Select the Akira -> src folder
-
Run Akira.java (main class)
##๐ฎ Controls Action Description: Left Click --> Add new planet , Right Click + Drag --> Pan , Scroll Wheel --> Zoom in/out , Pause Button --> Pause/Resume simulation , "Show Info" Button --> Toggle coordinates/velocity info ๐ง Physics Based on Newton's Law of Universal Gravitation:
F = G * (m1 * m2) / rยฒ
Euler integration for position and velocity updates.
##๐ License This project is licensed under the MIT License โ feel free to use and modify.
##๐ค Contributing Pull requests are welcome! If you have cool ideas (collisions? orbit trails? black holes?), bring them in.
##โญ๏ธ If you like this project... Give it a star ๐ on GitHub!