Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have a 3D line represented by the intersection of these two planes



I need to compute two 3D points $P_1=(x_1,y_1,z_1)$ and $P_2=(x_2,y_2,z_2)$ belonging to the line and I have a reliable, robust and accurate SVD algorithm implementation in my software library.

My first idea is to solve the first plane equation for $x$:


and then plug the $x$ into the second plane equation and solve it for $y$:


Now I choose a value for $z_1$, for example $z_1=0$ and compute $y_1$ from $f_2(z_1)$ and $x_1$ from $f_1(y_1,z_1)$; I can also choose another value $z_2\ne z_1$ and compute in the same way $y_2$ and $x_2$. In this way I had to write a specific algorithm to compute the $P_1$ and $P_2$ coordinates and I cannot use the available SVD algorithm.

Then I had a look at Multiple View Geometry in Computer Vision, Second Edition by Richard Hartley and Andrew Zisserman where in section 3.2.2 Lines - Null-space and span representation they wrote that:

$W=\begin{bmatrix}x_1 & y_1 & z_1 & 1\\x_2 & y_2 & z_2 & 1\end{bmatrix}$

$W^*=\begin{bmatrix}a_1 & b_1 & c_1 & d_1\\a_2 & b_2 & c_2 & d_1\end{bmatrix}$


$W^* W^T=\begin{bmatrix}0 & 0 \\0 & 0 \end{bmatrix}$

and that I can go from $W^*$ to $W$ by means of SVD, thus I can use the available SVD algorithm. It is not clear to me how to use the SVD algorithm to solve the problem, can you explain it?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Take the SVD from your known $W^*$ to get $$ W^* = USV^T$$ with the singular values in $S$ $$ S =\begin{bmatrix}\sigma_1 & 0 & 0 & 0\\ 0 & \sigma_2 & 0 & 0\end{bmatrix} $$

To obtain $W$ then you want $W$ such that $$ W^*W^T = USV^TW^T =\begin{bmatrix}0 & 0 \\0 & 0 \end{bmatrix} $$

Because $V$ is a unitary matrix, you can select from the last two rows. Say you have $$ V^T = \begin{bmatrix} \mathbf{v}_1^T \\ \mathbf{v}_2^T \\ \mathbf{v}_3^T \\ \mathbf{v}_4^T \\\end{bmatrix}$$ then $$V^T\begin{bmatrix}\mathbf{v}_3 & \mathbf{v}_4\end{bmatrix}=\begin{bmatrix}0 & 0 \\ 0 & 0 \\ 1 & 0 \\ 0 & 1\end{bmatrix}$$ So that gives $$W^T = \begin{bmatrix}\mathbf{v}_3 & \mathbf{v}_4\end{bmatrix} K$$

Where $K$ is as desired since the final result is zero: $$U\begin{bmatrix}\sigma_1 & 0 & 0 & 0\\ 0 & \sigma_2 & 0 & 0\end{bmatrix}\begin{bmatrix}0 & 0 \\ 0 & 0 \\ 1 & 0 \\ 0 & 1\end{bmatrix}K = U\begin{bmatrix}0 & 0 \\0 & 0 \end{bmatrix}K =\begin{bmatrix}0 & 0 \\0 & 0 \end{bmatrix}$$

Now $K$ may be used to have your $1$ values in the positions you show them for $W$.$$W = K\begin{bmatrix}\mathbf{v}_3^T \\ \mathbf{v}_4^T\end{bmatrix}$$

share|improve this answer
Thank you! If I understood your answer, $K$ is a constant matrix (with an appropriate form), and I do not need to compute it, isn't it? This is because basically my solution is just $P_1=\mathbf{v}_3^T$ and $P_2=\mathbf{v}_4^T$ that I get from the SVD, am I right? And because if $P_1$ is a point on my line, $k_1\cdot P_1=(k_1\cdot x_1,k_1\cdot y_1, k_1\cdot z_1)$ will still be a point on my line. –  Alessandro Áleifur Jacopson Mar 22 '13 at 8:11
yes. I was only considering that you had the ones in the last position for $W$. Any non-singular $K$ may be chosen for any reason that it can help with. You may not need to compute it for your application, correct. –  adam W Mar 22 '13 at 12:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.