This simulation visually demonstrates the principles of orbital mechanics governed by Newtonian gravity. At its core, it models the two-body problem, specifically the interaction between a massive central star (the Sun) and a much smaller orbiting planet (the Earth). By adjusting parameters like the masses of the Sun and Earth, their initial distance, and the Earth's initial tangential velocity, you can observe fundamental concepts such as the conservation of angular momentum and specific orbital energy. The simulation calculates key orbital characteristics like eccentricity (e), semi-major axis (a), and semi-minor axis (b). Eccentricity, a measure of how much an orbit deviates from a perfect circle, is crucial: an 'e' value less than 1 results in an elliptical orbit (like planets in our solar system), 'e' equal to 1 signifies a parabolic escape trajectory, and 'e' greater than 1 represents a hyperbolic, unbound path. The simulation dynamically draws the resulting orbital path, tracks the planet's position and velocity, and even includes a polar graph illustrating its angular displacement (theta) and radial distance. A collision detection system highlights when the planet's path would intersect the Sun, demonstrating the dramatic consequences of insufficient orbital velocity, pausing the simulation and resetting parameters for a new exploration.
F = G * M * m / r^2h = r * v_tangentialε = (1/2) * v^2 - G * M / re = sqrt(1 + (2 * ε * h^2) / (G^2 * M^2))e < 1 for an ellipse, e = 1 for a parabola, and e > 1 for a hyperbola.
a = -G * M / (2 * ε) (for ellipses)b = a * sqrt(1 - e^2) (for ellipses)T = 2 * π * sqrt(a^3 / (G * M))