Unified formulation for the stiffness analysis of spatial mechanisms