function jac=frog_jac(u)
% this function takes an input u=[theta,phi,d]
% and returns the Jacobian at this point.

b = 0.1;
h = 0.03;
d = 0.1;

jac(1,1) = -b*sin(u(1))-(h+u(3))*sin(u(1)+u(2));
jac(1,2) = -(h+u(3))*sin(u(1)+u(2));
jac(1,3) = cos(u(1)+u(2));

jac(2,1) = b*cos(u(1))+(h+u(3))*cos(u(1)+u(2));
jac(2,2) = (h+u(3))*cos(u(1)+u(2));
jac(2,3) = sin(u(1)+u(2));
