Habitable Zone Simulator
Mousumi Narlin
Drag a planet toward or away from a star and watch it heat, cool, and change color as real physics decides its habitable or not

What it does
A star and planet interact under real Newtonian gravity, integrated with a leapfrog integrator so the orbit stays stable instead of drifting apart over time. As you drag the planet closer to or farther from the star, the simulation calculates the actual flux (energy per second) it receives using the inverse-square law, then derives its equilibrium temperature from that. A glowing band around the star marks the habitable zone — the distance range where that temperature keeps water liquid (273K–373K). Both the star's and the planet's colors are computed from real blackbody radiation physics rather than hardcoded. The star's color reflects its surface temperature, and the planet shifts from white-hot/scorched near the star, to a blue-green Earth-like tone inside the habitable band, to pale icy blue-white once too far out. A live readout shows distance, flux, and estimated temperature updating in real time as you interact. The hardest part was making sure the orbit stayed physically correct even while the planet is being dragged and then released back into free orbit — this required carefully separating user-controlled position updates from the physics engine's own gravity-integration step. However,we can still keep researching on how to make life possible even in the worst case scenarios.