Removed this post because I thought it was solved, having to add it again. What is the gradient of acos(u1*u2) (u1 and u2 are the unit vectors)? Apparently the gradient of u1*u2 is u2-(u1*u2)u1 and I know the derivative of acos is -1/sqrt(1-x), but I'm slightly confused here. Thanks for any help.