Generation of closed-form inverse kinematics for reconfigurable robots