# Inner Solar System Orrery — Solar Sail

A single-file Three.js (WebGL) orrery: open `index.html` through any static server, e.g. `python3 -m http.server`, then visit `http://localhost:8000/`. Three.js r160 is loaded from the jsDelivr CDN through an import map. There is no build step.

## What you see
- **Sun**: animated granulation shader on the sphere, plus a camera-facing corona shader with drifting streamers.
- **Mercury, Venus, Earth, Mars**: placed on Keplerian orbits from the J2000 mean elements (eccentricity, inclination, node, perihelion), with true relative periods. Distances are to scale at 1 AU = 30 units. Body sizes are exaggerated.
- **Moon**: inclined orbit with a regressing node and a 27.32-day period. Its distance from Earth is exaggerated.
- **Orbits and trails**: full orbit ellipses, plus fading trails behind each body and the sail.
- **Solar sail**: integrated in the ecliptic plane with RK4 under solar gravity plus an ideal flat-sail radiation force `a = a_c · (1 AU / r)² · cos²α · n̂`. The sail normal `n̂` is tilted by the cone angle α from the Sun line toward the prograde direction. The sail mesh rotates so its reflective face points sunward at angle α. The orange arrow is the thrust direction and the dashed line points to the Sun. The sail launches from Earth and relaunches automatically if it passes 2.6 AU or falls inside 0.2 AU.

## Controls
| Control | Action |
|---|---|
| **Time warp** slider | 0 – 365 days per second (default 20 d/s) |
| **Pause / 1 / 20 / 100 / 365 d/s** buttons | Pause or set common warp rates |
| **Focus** buttons | System overview, Sun, Mercury, Venus, Earth, Moon, Mars, Solar Sail. The camera flies to the target and then follows it. |
| Clicking a label | Focuses that body |
| **Labels / Trails / Orbits** checkboxes | Show or hide each layer |
| **Sail tilt** slider | Cone angle from −90° to 90°. About +35° spirals outward fastest, negative angles spiral inward, and 0° pushes straight outward with no spiral. |
| **Sail char. acceleration** slider | Sail lightness, 0.1 – 3 mm/s² at 1 AU |
| **Relaunch sail** | Restarts the sail from Earth |
| **Auto tour** | Restarts the camera tour |
| Mouse | Drag to orbit, wheel to zoom, right-drag to pan |
| Keyboard | `Space` pause · `1`–`8` focus targets · `T` tour · `L` labels |

## Idle auto-play
On load, time runs at 20 days/s. The camera tours the system overview, the Sun, each planet, and then follows the solar sail, slowly orbiting each target, and repeats. Any mouse, keyboard or UI input hands control to you. The tour resumes after 25 s with no input.
