In this paper, we study the solutions to two types of unit dual quaternion equations, namely \(\varvec{a}\check{x} = \check{x}\varvec{b}\) and \(\varvec{a}\check{x} = \check{z}\varvec{b}\) . Due to the \(2\) -norm of the dual quaternion vector, there may exist multiple potential solutions for these equations. The main contribution of this study is the introduction of a novel formulation for subspace constrained least squares solutions to these two unit dual quaternion equations, along with the derivation of closed-form expressions for these solutions. We develop and implement numerical algorithms to address the robot-world and hand-eye calibration problems. Our findings demonstrate that the proposed subspace constrained least squares solution can avoid discussing the ambiguities associated with the non-uniqueness of signs that arise when mapping from rotation matrices to quaternions. Furthermore, we establish that when the transformation matrix equation related to the robot-world or hand-eye calibration problem possesses a solution, the corresponding unit dual quaternion is indeed a subspace constrained least squares solution to the equations \(\varvec{a}\check{x} =\check{x}\varvec{b}\) and \(\varvec{a}\check{x} = \check{z}\varvec{b}\) , respectively. The experimental results demonstrate that the proposed subspace constrained least squares solutions are competitive when compared to existing solution methods.