Is there a way to further simplify this vector algebra term?

123 Views Asked by At

I am currently deriving the kinematics of a complex robotic system, and after a lot of calculations arrived at this final vector equation that fully describes the system$^1$ \begin{align*}\omega &= -2\arctan\left(\frac{k_1\mp \sqrt{k_1^2-\left(k_3-k_2\right)\left(k_2+k_3\right)}}{k_3-k_2}\right) \text{ where}\\ \end{align*} \begin{align*} k_1^j &= \hphantom{-} \mathbf{z}_{\hat{3}} \cdot \left(\mathbf{z}_1\times \mathbf{z}_2\right)\\ k_2^j &= -\mathbf{z}_{\hat{3}}\cdot \left(\mathbf{z}_1 \times \left(\mathbf{z}_1\times \mathbf{z}_2\right)\right)\\ k_3^j &= \hphantom{-} \mathbf{z}_{\hat{3}} \cdot \left(\mathbf{z}_1\times \left(\mathbf{z}_1 \times \mathbf{z}_2\right)\right) + \mathbf{z}_2\cdot\left(\mathbf{z}_{\hat{3}}-\mathbf{z}_3\right). \end{align*} $\mathbf{z}_1,\mathbf{z}_2,\mathbf{z}_3,\mathbf{z}_{\hat{3}}$ are four distinct $3\times 1$ vectors of the form $$\mathbf{z}_i = \begin{pmatrix}\cos(\varphi_i)\sin(\Theta_i)\\\sin(\varphi_i)\sin(\Theta_i)\\\cos(\Theta_i)\end{pmatrix}.$$ $\cdot$ is the dot product and $\times$ is the cross product.

If substitued into the equation, the argument of the $\arctan$ becomes

$$\frac{\mathbf{z}_{\hat{3}}\cdot \left(\mathbf{z}_1\times\mathbf{z}_2\right)\mp\sqrt{\left[\mathbf{z}_{\hat{3}}\cdot\left(\mathbf{z}_1\times\mathbf{z}_2\right)\right]^2-\left[2\mathbf{z}_{\hat{3}}\cdot\left(\mathbf{z}_1\times\left(\mathbf{z}_1\times\mathbf{z}_2\right)\right)+\mathbf{z}_2\cdot\left(\mathbf{z}_{\hat{3}}-\mathbf{z}_3\right)\right]\left[\mathbf{z}_2\cdot\left(\mathbf{z}_{\hat{3}}-\mathbf{z}_3\right)\right]}}{2\mathbf{z}_{\hat{3}}\cdot \left(\mathbf{z}_1\times\left(\mathbf{z}_1\times\mathbf{z}_2\right)\right)+\mathbf{z}_2\cdot\left(\mathbf{z}_{\hat{3}}-\mathbf{z}_3\right)}.$$

As this term will be utilized for all further calculations, including symbolic ones, it would be very useful to simplify it as far as possible. Are there any vector algebra tricks that I could apply to this expression?

Thank you in advance, and Merry Christmas!

$^1$ For the curious, $\omega$ is the joint angle of an actuator and $\mathbf{z}_i$ are joint axes of a leg connecting the actuator with the effector.