where ${{\mathbf{k}}^{T}}\mathbf{v}$ is a third order polynomial with terms ${\bf{v}} = [s_1^2{t_1},s_1^2{t_2},s_1^2{t_3},s_1^2,{s_1}{s_2},{s_1}{s_3},{s_1},s_2^2{t_1},s_2^2{t_2},s_2^2{t_3}, s_2^2,{s_2}{s_3}, \\ {s_2},s_3^2{t_1},s_3^2{t_2},s_3^2{t_3},s_3^2,{s_3},{t_1},{t_2},{t_3},1{]^T}$.

First-Order Optimality Conditions
---------------------------------

Now we consider the least-squares problem (\[equ:4\]). Using (\[equ:9\]), the squared residual can be represented as

$$\label{equ:10}
r_g^2 = \frac{{q\left( {{\bf{s}},{\bf{t}}} \right)}}{{{{\left( {1 + {{\bf{s}}}^T{\bf{s}}} \right)}^2}}}$$

where $q\left( \mathbf{s},\mathbf{t} \right)={{\mathbf{v}}^{T}}\mathbf{k}{{\mathbf{k}}^{T}}\mathbf{v}$ is a 6th order polynomial in $\mathbf{s}$ and $\mathbf{t}$. For the point-to-line distance $\mathbf{r}_{l_i}^{T}{{\mathbf{r}}_{l_i}}$ in (\[equ:4\]), we have $$\label{equ:11}
\mathbf{r}_{l_i}^{T}{{\mathbf{r}}_{l_i}}={{\left( r_{l_i}^{1} \right)}^{2}}+{{\left( r_{l_i}^{2} \right)}^{2}}+{{\left( r_{l_i}^{3} \right)}^{2}}$$ As mentioned above, $r_{l_i}^{1},$ $r_{l_i}^{2}$ and $r_{l_i}^{3}$ all have the same form as ${{r}_{g}}$. Therefore, the point-to-line distance $\mathbf{r}_{l_i}^{T}{{\mathbf{r}}_{l_i}}$ will have the same form as (\[equ:10\]). Similarly, $\mathbf{r}_{p}^{T}{{\mathbf{r}}_{p}}$ will also yield the same form as (\[equ:10\]). After the summation of squared residuals in (\[equ:4\]), we know that ${{C}_{\pi lp}}$ would have the same rational form as (\[equ:10\]). We write it as $$\label{equ:12}
{{C}_{\pi lp}}\left(\mathbf{s},\mathbf{t}\right)=\frac{{{{\bar{C}}}_{\pi lp}}\left( \mathbf{s},\mathbf{t} \right)}{{{\left( 1+{{\mathbf{s}}^{T}{\mathbf{s}}} \right)}^{2}}}$$ where ${{\bar{C}}_{\pi lp}}$ is a 6th order polynomial function in $\mathbf{s}$ and $\mathbf{t}$. To find the critical points of (\[equ:12\]), we first calculate its first order optimality conditions as follows: $$\label{equ:13}
\begin{array}{l}
{g_{{s_i}}} = \frac{{\partial {C_{\pi lp}}}}{{\partial {s_i}}} = \frac{1}{{{{\left( {1 + {{\bf{s}}^T}{\bf{s}}} \right)}^3}}}\left( {\left( {1 + {{\bf{s}}^T}{\bf{s}}} \right)\frac{{\partial {{\bar C}_{\pi lp}}}}{{\partial {s_i}}} - 4{s_i}{{\bar C}_{\pi 