Checkout how this animation mimics robotics, everything at the right place at the right time. The questions of where the maths is applied are answered, in part.
Here's a file to dive in