# TransEqns.m

TransEqns.m — Objective-C source code, 1Kb

## File contents

function PostImpact = TransEqns(Pre_Impact) % This function relates the pre-impact state to the post-impact state. % The eqns can be derived by using the prinicple of conservation of % angular momentum. The stance & swing leg angles are related by geometry % and the two eqns for angular velocity come from: (1) conservation of % angular momentum (for the entire system) about the contact point, and (2) % conservation of angular momentum about the hip (for the swing leg). % c.f. http://ruina.tam.cornell.edu/research/topics/... % locomotion_and_robotics/papers/simplest_walking/... % simplest_walking_gomes.pdf % for complete details regarding the derivation. theta = Pre_Impact(1); phi = Pre_Impact(2); thetadot = Pre_Impact(3); phidot = Pre_Impact(4); PostImpact = [-1, 0, 0, 0;... -2, 0, 0, 0;... 0, 0, cos(2*theta), 0;... 0, 0, cos(2*theta)*(1-cos(2*theta)), 0]*Pre_Impact; end