Convex Optimisation for Inverse Kinematics