Roller Coaster Energy (2D)

This 2D side-view roller coaster demonstrates conservation of mechanical energy: as the cart climbs and descends hills and threads a loop, kinetic energy (½mv²) and gravitational potential energy (mgh) continuously trade places while their sum stays nearly constant, dropping only slightly to friction on every pass. Adjust the start height to control how much energy the cart begins with, raise the friction coefficient to see the total-energy bar shrink faster and the cart settle sooner, and change the cart mass to see how the energy values scale even though the speed profile itself stays the same. Watch the live KE/PE/Total energy bars and the speed and height readouts update in real time, and try starting too low to see the cart fail the loop's minimum-speed test (v² ≥ g·r) and fall from the track.