A Quaternion-Based Formulation for Solving the Inverse and Forward Position Problem of Serial, Parallel and Hybrid Robots