Automatic Geometric Decomposition for Analytical Inverse Kinematics