A three-dimensional kinematic and dynamic model of the lower limb