C++20 sections · 1024 units
Open in Course

Young Physicist - The Idea

Group related coordinates

The insight: a force vector naturally groups three related values. Create a struct with x, y, and z fields. This keeps coordinates together instead of scattered across separate variables.

You don't need to store all vectors. Keep a running sum instead. Start with a sum struct initialized to (0, 0, 0). As you read each force, add its components to your sum's x, y, and z fields.

After processing all forces, check if the sum equals (0, 0, 0). Equilibrium means every component cancels out. One non-zero component breaks equilibrium.