Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I don't know how to solve such an equation:

$$ t = - \frac{ \begin{vmatrix}1&1&1&1\\x_0&x_1&x_2&x_4\\y_0&y_1&y_2&y_4\\z_0&z_1&z_2&z_4\end{vmatrix}}{\begin{vmatrix}1&1&1&0\\x_0&x_1&x_2&(x_5-x_4)\\y_0&y_1&y_2&(y_5-y_4)\\z_0&z_1&z_2&(z_5-z_4)\end{vmatrix}} $$

Among Wolfram's Mathworld, I need this to calculate the Intersection of a Line and a Plane in 3Dimensional Space. (read here)

I would really appreciate if someone can show me how to solve this equation step by step, or least some useful links.

For example, given the following values:

$$ V_0 = \hspace{2mm} \begin{array}{c} 0 \\ 0 \\ 0 \end{array} \hspace{5mm} V_1 = \hspace{2mm} \begin{array}{c} 0 \\ 5 \\ 0 \end{array} \hspace{5mm} V_2 = \hspace{2mm} \begin{array}{c} 0 \\ 0 \\ 5 \end{array} \hspace{15mm} V_4 = \hspace{2mm} \begin{array}{c} 10 \\ 1.5 \\ 1.5 \end{array} \hspace{5mm} V_5 = \hspace{2mm} \begin{array}{c} 5 \\ 1.5 \\ 1.5 \end{array} \hspace{5mm} $$

While $ V_0 $ - $ V_2 $ describe the Plane and $ V_4 $ and $ V_5 $ the Line that should intersect with the Plane.

Thank you !

share|cite|improve this question
They're determinants. – J. M. Oct 11 '11 at 14:55
What do you mean with "solve"? Do you want to calculate $t$? Do you know the relation between the V and the x, y, z? – Phira Oct 11 '11 at 15:21
Your plane is $x=0$, and your line is $y=z=1.5$, so it is easy to see that $(0,1.5,1.5)$ is the solution. – deinst Oct 11 '11 at 15:46
@J.M. Thanks for the link, I will read this. Sorry for the unclearness. I want to know how it is solved with any parameters. How would you write it on a paper to obtain t ? There are for sure some steps in solving this formular. – Niklas R Oct 11 '11 at 16:13
up vote 4 down vote accepted

You could write an equation for the plane, write another equation for the line and then solve the system of equations. Your plane vectors can be parameterized as follows:

$$P=\{(0,0,0)+s(0,5,0)+t(0,0,5)\}$$ $$x=0, \qquad y=5s, \qquad z=5t$$ Your line can be parameterized as well: $$L=\{(10,1.5,1.5)+r[(10,1.5,1.5)-(5,1.5,1.5)]\}=\{(10,1.5,1.5)+r(5,0,0)\}$$ $$x=10+5r, \qquad y=1.5, \qquad z=1.5$$ So for these to intersect, $x, y,$ and $z$ must be equal. You don't even necessarily need to solve these, just note that it is possible for them to all be equal in exactly one configuration...

Edit: This is basically just an explanation of what deinst was saying above in the comments.

You wanted to know how to solve these in general. Rather than do a literal "generalized" version, which would probably not shed much light on the subject, I will do another problem from the book I am working on (this is from Apostol Calculus Vol. I. section 13.8 # 10):

Let $L$ be the line through $(1,1,1)$ parallel to the vector $(2,-1,3)$, and let $M$ be the plane through $(1,1,-2)$ spanned by the vectors $(2,1,3)$ and $(0,1,1)$. Prove that there is one and only one point in the intersection $L\cap M$ and determine this point.

We start by defining $$L=\{(1,1,1)+s(2,-1,3)\}$$ $$M=\{(1,1,-2)+t(2,1,3)+r(0,1,1)\}$$

where $s,t,$ and $r$ are allowed to vary as scalars. From $L$ we have the following parameterizations: $$x=1+2s, \qquad y=1-s, \qquad z=1+3s$$ And from $M$ we have these parameterizations: $$x=1+2t, \qquad y=1+t+r, \qquad z=-2+3t+r$$

We are looking for the intersection of the line and the plane, and at this intersection (by definition) both requirements on the sets must hold. Thus the $x, y$, and $z$ values above must be the same (after all, a point is equal to another only if it's x, y, and z values are equal to each other). We are therefore motivated to remove the parameters, which are allowed to vary on their own in each parameterization. Use any method you would like to do this, so that you get the line and plane parameterizations "un-parameterized".

For the line: $y=1-s \implies s=1-y$. Substituting, $x=1+2(1-y)=3-2y$ and $z=1+3(1-y)=4-3y$

For the plane: solving for $s$ and $t$ in terms of $x$, $y$, and $z$ yields and substituting yields the Cartesian equation for the plane; or if you know how to create a normal vector you should be able to come up with the Cartesian equation pretty quickly: $$-x-y+z=-4$$

Now we simply substitute the equations we have for the line into the equation for the plane:

$$-(3-2y)-y+(4-3y)=1-2y=-4 \implies y=\tfrac 5 2$$

Now substituting back into the handy equations from the line, $$x=3-2(\tfrac 5 2 )=-2, \qquad z=4-3(\tfrac 5 2)=\tfrac 7 2$$

So $(-2, \tfrac 5 2, \tfrac {-7} 2)$ is the point of intersection between the line and the plane.

Now, since all of these results were necessarily true, any other point in the intersection would have to meet all of these requirements, all the way down to our result of the values for each cooridinate of the point. Therefore this is the only point in the intersection.

Sorry if this post was way to didactic, I was actually doing a lot of that for my own benefit, to make sure I could properly do this sort of problem.

The basic idea is to parameterize the information given, then "un-parameterize" it and solve the resulting set of simultaneous equations. This approach is entirely algebraic, and does not require determinants, though that would provide a truly more "general" solution.

share|cite|improve this answer
Awesome, really. Just great. Thank you very much. – Niklas R Oct 20 '11 at 16:53

$t$ is the ratio of the determinants of two 4-by-4 matrices: $$t = \frac{\left\lvert\begin{matrix} 1 & 1 & 1 & 1 \\ x_1 & x_2 & x_3 & x_4 \\ y_1 & y_2 & y_3 & y_4 \\ z_1 & z_2 & z_3 & z_4 \end{matrix}\right\rvert}{\left\lvert\begin{matrix} 1 & 1 & 1 & 0 \\ x_1 & x_2 & x_3 & (x_5 - x_4) \\ y_1 & y_2 & y_3 & (y_5 - y_4) \\ z_1 & z_2 & z_3 & (z_5 - z_4) \end{matrix}\right\rvert}$$ where $(x_1, y_1, z_1)$, $(x_2, y_2, z_2)$, and $(x_3, y_3, z_3)$ are three non-collinear points that determine the plane, and the line passes through $(x_4, y_4, z_4)$ and $(x_5, y_5, z_5)$. The intersection point is at $$\begin{cases} x = x_4\;+\;t\,(x_5-x_4) = (1-t)\,x_4\;+\;t\,x_5\\ y = y_4\;+\;t\,(y_5-y_4) = (1-t)\,y_4\;+\;t\,y_5\\ z = z_4\;+\;t\,(z_5-z_4) = (1-t)\,z_4\;+\;t\,z_5 \end{cases}$$ The rightmost form is better with floating-point numbers, particularly when the magnitudes of the coordinates of points 4 and 5 differ a lot.

The pseudocode to calculate $t$ is not that complicated. (I let Maple calculate the determinants and find an efficient way to calculate it.)

function plane_line_intersection(x1, y1, z1,  x2, y2, z2,  x3, y3, z3,
                                 x4, y4, z4,  x5, y5, z5,  epsilon):
    t9 = y5 - y4
    t8 = z1 - z2
    t7 = z1 - z3
    t6 = z1 - z4
    t5 = z2 - z3
    t4 = z2 - z4
    t3 = z3 - z4
    t2 = y1*t5 - y2*t7 + y3*t8
    t1 = x5*t2 - t8*(x3*t9 + x4*y3) + t7*(x2*t9 + x4*y2) - t5*(x1*t9 + x4*y1) + (z5 - z4) * (x3*(y1 - y2) + x2*(y3 - y1) + x1*(y2 - y3))
    if (abs(t1) <= abs(epsilon)) then:
        return NO_INTERSECTION
        return (x4*t2 - x3*(y1*t4 - y2*t6 + y4*t8) + x2*(y1*t3 - y3*t6 + y4*t7) - x1*(y2*t3 - y3*t4 - y4*t5)) / t1
    end if
end function

The epsilon above is the precision limit; you can use 0, but you should use some small positive value, depending on the typical magnitude of your coordinates.

share|cite|improve this answer

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.