Simple Java desktop simulation of the solar system with elliptical orbits, labels, controls, and a lightweight 3D-like projection.
- Java 25 by default (Gradle toolchain, override with
-PjavaVersion=21if needed) - Swing/AWT for UI and rendering
- Gradle (with wrapper)
- Jackson (JSON loading for planet data)
- JUnit 5 for unit tests
src/main/java/com/raph/solarsystem/- app entry point and UI wiringsrc/main/java/com/raph/solarsystem/model/- domain model + physics + JSON loadersrc/main/java/com/raph/solarsystem/controller/- simulation state/control logicsrc/main/java/com/raph/solarsystem/view/- renderer + controls panelsrc/main/resources/planets.json- planet datasetsrc/test/java/com/raph/solarsystem/- unit testsdocs/PLANET.md- data documentationdocs/PHYSICS.md- formulas and motion modeldocs/ORBIT_ENGINE.md- formula-to-code mapping
./gradlew runIf Java 25 is not installed locally, use:
./gradlew -PjavaVersion=21 run./gradlew test- Speed slider and presets (
1x,10x,100x) - Pause/Resume, Reset
- 3D tilt toggle + strength slider
- Hover info toggle
- FPS slider + presets (
20,30,60) - Performance mode (reduced render cost)
- Zoom slider +
Fit - Mouse wheel zoom
- Keyboard zoom:
+,-,0(fit) - Language selector: English / French / Japanese
a(semiMajorAu): semi-major axis, orbit size (in AU).e(eccentricity): orbit shape (0circular, closer to1more elongated).P(periodDays): time for one full orbit (days).n(mean motion): average angular speed,n = 2π / P.M(mean anomaly): time-based orbital phase angle.E(eccentric anomaly): intermediate angle solving Kepler equation.ν(true anomaly): actual geometric angle of the planet from perihelion.- Perihelion: closest distance to Sun,
a(1 - e). - Aphelion: farthest distance from Sun,
a(1 + e).
For details and formulas, see docs/PHYSICS.md and docs/ORBIT_ENGINE.md.
- Model-Controller-View split:
- Model: planet data and orbital calculations
- Controller: mutable simulation settings and time progression
- View: rendering and UI controls
flowchart LR
A[ControlsPanel<br/>UI events] --> B[SolarSystemController<br/>state + simulation flags]
B --> C[SolarSystemModel<br/>time + planets]
C --> D[SolarSystemRenderer<br/>draw orbits/planets/HUD]
D --> E[SolarPanel - Swing<br/>paintComponent]
F[planets.json] --> C
Quick read:
ControlsPanelupdates controller settings (speed, fps, tilt, zoom, etc.)SolarPaneltimer ticks call controller/model progressionSolarSystemRendererreads model + render context and draws the frameplanets.jsonis the source of orbital/display data