The general equation of a plane in 3-D is given by $$\mathbf{(p-p_0).n}=0$$
where $\mathbf{p}$ is any general point on the plane, and $\mathbf{p_0}$ is any known point on the plane. $\mathbf{n}$ is a vector normal to the plane.
The equation of a line is given by $$\mathbf{p = l_0+}t\mathbf{l} $$
where $\mathbf{l_0}$ is any point on the line.
If the line lies in the plane, it must satisfy two conditions-
It must be perpendicular to the normal to the plane i.e. $\mathbf{l.n}=0$
$\mathbf{l_0}$ must lie in the plane i.e. satisfy the plane's equation. So, $\mathbf{(l_0-p_0).n} = 0$
You can calculate $\mathbf{p_0,l_0}$ very easily with the information you have.
$\mathbf{p_0}$ can be calculated by choosing any two of $x,y,z$ and finding the third to satisfy the equation of the plane. $\mathbf{l_0}$ is precisely $\vec O$ that you already know. You can use them to cross-check whether the fit is good or not. But they do not depend on $\mathbf{l}$. So, they are secondary, and may be used as a sanity check later on.
Suppose you are given the equation of the line as $ax+by+cx+d = 0$. You can recast it as $[(x,y,z)-\mathbf{p_0}].(a,b,c)$. So, $(a,b,c)$ is your normal vector.
Suppose you have $m$ planes with normals $\mathbf{n_1,n_2,\ldots,n_m}$. Then, your overall constraints are $$\mathbf{l.n_1} = 0 \\ \mathbf{l.n_2} = 0 \\ \ldots \\\mathbf{l.n_m}=0$$.
It is a system of linear equations with 3 variables and $m$ equations. You need to find out $\mathbf{l}$, which can be found up to a constant factor by the standard least squares method, provided $m>3$, which should not be a worry for you. If you code carefully enough, you can implement all of it in matrix terms.
Hope it helps.
Yes, your tutor is correct.
The reason is that if the planes meet in a line parallel to the plane $x=0$, then their intersection contains no points of the form $(0,y,z)$, i.e. points where the $x$-coordinate is $0$.
Points where the $x$-coordinate is $0$ are exactly the ones in the plane $x=0$.
So in case the line of intersection is parallel to the plane $x=0$, you can choose instead to put $y=0$ in both equations and continue in the same way.
Best Answer
Suppose there are $m (m\geq 4)$ planes, for plane number $k$ we know a point $\mathbf{x}_k = (x_{k,1},x_{k,2},x_{k,3})$ on the plane, and the unit normal vector for plane number $k$ is $\mathbf{n}_k$.
Here I am not sure whether you mean by "a point for each plane", or "a common point for all planes", both are discussed.
If we assume that all planes pass through point $\mathbf{x}_0$. Then this line can be represented using this point $\mathbf{x}_0$ and a direction $\mathbf{b} = (b_1,b_2,b_3)$ $$ \mathbf{x} = \mathbf{x}_0 + t\mathbf{b} \quad\text{ for } t\in \mathbb{R} $$ Then the problem does not need least-square treatment at all, as we are not solving an overdetermined system, $\mathbf{b}$ can be obtained simply by cross product any two normals: $$ \mathbf{b} = \mathbf{n}_1\times\mathbf{n}_2, \tag{1} $$ where $\times$ is the cross product of vectors. Because the normal vectors of all the planes are coplanar (thus the planes intersect at exactly one line), $\mathbf{b}\perp \mathbf{n}_1, \mathbf{n}_2,\ldots, \mathbf{n}_m$. And we are done.
If we only know a point for each plane, and we do not know if they all passing through one common line. Things get more complicated. The least square problem may not be well-posed. We want this line being perpendicular to every plane (as much as possible), and passing through a point that has the minimal distance to all the planes. The equation system for $\mathbf{x} = (x_1,x_2,x_3)$ is: $$ \mathrm{dist}(\mathbf{x},P_k) = |\mathbf{n}_k \cdot (\mathbf{x} - \mathbf{x}_k )| = 0 $$ written in matrix form $$ \mathbf{N}\mathbf{x}:= \begin{pmatrix}n_{1,1} &n_{1,2} &n_{1,3} \\ n_{2,1} &n_{2,2} &n_{2,3} \\ \vdots&\vdots&\vdots \\ n_{m,1} &n_{m,2} &n_{m,3}\end{pmatrix}\begin{pmatrix}x_1 \\x_2 \\x_3\end{pmatrix} = \mathbf{y} := \begin{pmatrix}\mathbf{n}_1 \cdot \mathbf{x}_1 \\ \mathbf{n}_2 \cdot \mathbf{x}_2 \\ \vdots \\ \mathbf{n}_m \cdot \mathbf{x}_m\end{pmatrix}\tag{2} $$ where $\mathbf{N}$ is an $m\times 3$ matrix, which is basically the list of all the normal vectors row by row. The least square formulation for problem (2) is to minimize: $$ \min_{\mathbf{x}} \|\mathbf{N}\mathbf{x}-\mathbf{y}\|, $$ where the norm is just Euclidean norm, the solution is the point $\mathbf{x}_0$ satisfying: $$ \mathbf{N}^{T}\mathbf{N}\mathbf{x}_0 = \mathbf{N}^{T}\mathbf{y}. \tag{$\dagger$} $$ $(\dagger)$ is the first matrix equation you wanna solve. After we obtain this $\mathbf{x}_0$, we wanna find a $\mathbf{b}$ such that:
Either if all these planes intersecting at 1 line, we can find this $\mathbf{b}$ exactly for this line.
Or if they do not intersect at 1 line, but every two of them intersect at 1 line (no parallel planes, you can rule out parallel planes by checking same normals or normals with opposite signs but same in each component). We use least square to find it.
For the first case, we know that $\mathbf{b}$ satisfies: $$ \mathbf{b}\cdot \mathbf{n}_j = 0 $$ for every plane number $j$, because the line being on every plane means it is perpendicular to every normal vector $ \mathbf{n}_j $. In this case, simply computing (1) is enough.
For the second case, the least square system produced by $\mathbf{b}\cdot \mathbf{n}_j = 0$ is: $$ \min_{\mathbf{b}} \|\mathbf{N}\mathbf{b}\|, $$ and the solution is zero if these planes do not intersect. One possible way is simply compute the mean of $\mathbf{n}_i\times\mathbf{n}_j$, which is the intersecting line vector for every two of the planes, and set this mean as $\mathbf{b}$. Another way(essentially the same) is more least square'ish is try to solve the minimization: $$ \min_{\mathbf{b}} \sum_{i,j}\|\mathbf{b} - \mathbf{n}_i\times\mathbf{n}_j\|^2, $$ so that the resulting $\mathbf{b}$ is the closest line parallel to all intersecting line vector of every two of the planes in least square sense. In this minimization, you need to be careful with the normal direction because of $\mathbf{n}_i\times\mathbf{n}_j = -\mathbf{n}_j\times\mathbf{n}_i$, you wanna make sure all the intersecting line vector be about the same direction, i.e., $(\mathbf{n}_i\times\mathbf{n}_j)\cdot (\mathbf{n}_k\times\mathbf{n}_l) \geq 0$. The final minimizer is the mean of $\mathbf{n}_i\times\mathbf{n}_j$, for the case of four planes: $$ \begin{aligned} \mathbf{b} =& (\mathbf{n}_1\times\mathbf{n}_2 + \mathbf{n}_1\times\mathbf{n}_3 + \mathbf{n}_1\times\mathbf{n}_4 \\ &+\mathbf{n}_2\times\mathbf{n}_3 + \mathbf{n}_2\times\mathbf{n}_4 \\ &+ \mathbf{n}_3\times\mathbf{n}_4)/6, \end{aligned} $$ if we assume looking from the intersecting line perspective, the direction pointed by $\mathbf{n}_1$, $\mathbf{n}_2$, $\mathbf{n}_3$, to $\mathbf{n}_4$ is rotating counterclockwisely. For example in your picture you wanna make the fourth normal vector pointing the opposite direction.
For even larger data set, please refer to: http://en.wikipedia.org/wiki/Principal_component_analysis