Roller Coaster Energy Transfer (2D)

A 2D energy-conservation lab built around a real physics identity: E₀ = KE + PE + Heat, exactly, at every frame. Choose one of four spline track profiles — a classic hill-and-loop, a no-loop double hump, a steep drop into a large loop, or a gentle always-clears valley — then adjust start height, rolling friction, air drag and cart mass and watch the stacked energy bar and the scrolling energy-vs-time chart account for every joule. Loop tracks run a live v² ≥ g·r contact check with an analytically computed minimum launch height; hill tracks check whether the cart carries enough energy to crest the peak, and let it roll back and oscillate to a stop if it doesn't.