Block A (base)
Block B (middle)
Block C (top)
Center of mass
This 2D simulator draws the classic block-stacking overhang problem from the side: block A rests on a table, block B rests on A, and block C rests on B, each free to slide sideways and each with its own adjustable mass. Every animation frame recomputes the real mass-weighted center of mass at each joint — B+C combined over A's edge, C alone over B's edge, and the whole stack over the table — so you can see exactly how far each margin is from zero before slider input even changes it, purely from shifting how the total weight is distributed. Push any margin past zero and torque wins: that block rotates off and falls, exactly as real torque balance predicts.