The human body is a complicated machine whose movements involve many different joints, operated by a great many muscles. For that reason it is easy to get bogged down in detail when thinking about walking and running from a mathematical point of view.
Any position of the human body (or of any other jointed mechanism) can be described by giving the angles of joints. The number of angles needed for an unambiguous description is the number of degrees of freedom of the mechanism. For example, the position of a hinge joint is described by just one angle: a hinge allows only one degree of freedom. The human knee is a hinge. The ankle, however, allows rotation about two axes – you can tilt your foot toes up or toes down, and you can also rock it sideways so that the sole faces inwards towards the other foot – so it gives two degrees of freedom. The hip is a ball and socket joint allowing rotation about any axis through the centre of the ball, but any position can be described by just three angles (measured, for example, in three planes at right angles to each other), so it allows three degrees of freedom. In total, there are six degrees of freedom in each leg, making twelve in all, and suggesting that we need twelve equations of motion to describe walking. If we took account of the flexibility of the foot and the movements of the arms, we would need more.