Building a Physics Engine with C++ and Simulating Machines