Modeling Motion for Gait Analysis