equations of lines and planes

Equations of lines and planes

Lines

20250420-231609.png

Vector form

Assume we know the position coordinates of a point, call it point \[P=(x_{0},y_{0},z_{0})\]. Now, point \[P\] lies on a line (blue line), and the direction of the line is called a direction vector. Let \[\vec{v}=(a,b,c)\] be some vector that is parallel to the line (not necessarily having to be on the line itself).

Then, for any point on the line, \[Q=(x,y,z)\] we know that \[\overrightarrow{PQ}\] must be some scalar multiple of \[\vec{v}\] as both of them are parallel, i.e. \[\overrightarrow{PQ}=t\vec{v}\]. This gives us \[(x-x_{0},y-y_{0},z-z_{0})=t(a,b,c)\].

\begin{align*} (x-x_{0},y-y_{0},z-z_{0})&=t(a,b,c)\\ (x,y,z)-(x_{0},y_{0},z_{0})&=t(a,b,c)\\ (x,y,z)&=(x_{0},y_{0},z_{0})+t(a,b,c)\\ \end{align*}

Let \[\vec{r}=(x,y,z)\] and \[\vec{r_{0}}=(x_{0},y_{0},z_{0})\], we now have the equation \[\vec{r}=\vec{r_{0}}+t\vec{v}\]. This is known as the vector equation of a line.

20260414-234745.png
We can think of this equation as a continuous (and infinite) amount of dots generated by varying \[t\], which are so densely packed together that essentially form a solid line. (In the image above \[\mathbf{u}\] refers to our \[\vec{r_{0}}\])

If \[t\] is restricted to an interval \[\left[ t_{1},t_{2} \right]\], then \[L=\left\{ \vec{r_{0}}+t\vec{v},\,t_{1}\le t\le t_{2} \right\}\] becomes a line segment that connects \[\vec{r}\left( t_{1} \right)\] and \[\vec{r}\left( t_{2} \right)\].

Parametric form

From the equation above, we can rewrite it as

\begin{align*} (x,y,z)&=(x_{0},y_{0},z_{0})+t(a,b,c)\\ &=(x_{0}+ta,y_{0}+tb,z_{0}+tc) \end{align*}

Then, by comparison \[x=x_{0}+ta\], \[y=y_{0}+tb\] and \[z=z_{0}+tc\]. This set of equations is known as the parametric form of the equation of a line. Additionally, if we rearrange every equation with respect to \[t\], we will get the form \[\frac{x-x_{0}}{a}=\frac{y-y_{0}}{b}=\frac{z-z_{0}}{c}\], where \[a\], \[b\], \[c\] are non-zero. If \[a\], \[b\] or \[c\] is zero, that means that the corresponding coordinate does not change along the line, e.g. if \[a=0\], \[x=x_{0}+t\cdot0=x_{0}\], that is \[x\] stays constant throughout the line with a value of \[x_{0}\].

Planes

Before we go into the nitty gritty equations, we shall do a simple observation.

20260415-004405.png
In the image above, we can see that in order to go from the origin to point \[\mathbf{x}\] on the plane, we would first go to a known point \[P\] on the point, then \[\overrightarrow{PQ}\] and \[\overrightarrow{PR}\]. We can extend this idea to any point on the plane by multiplying \[\overrightarrow{PQ}\] and \[\overrightarrow{PR}\] by some scalar (this essentially lengthens or shortens both vectors). Therefore we have a rough idea that for any point \[\mathbf{x}\] on the plane, we can reach it by adding three terms, \[\mathbf{x}=\overrightarrow{OP}+s\,\overrightarrow{PQ}+t\,\overrightarrow{PR}\].

Parametric equation

20250413-044935.png
First, we start with the understanding that two linearly independent vectors span a plane through the origin. Call these two vectors \[\vec{u}\] and \[\vec{v}\] (or \[\vec{a}\] or \[\vec{b}\] based on the image above). Often however, we want a plane that does not pass through the origin. In this case, we require a point to act as the "anchor" this plane, which allows the plane to move off the origin. Let \[\vec{r_{0}}=\left( x_{0},y_{0},z_{0} \right)\] be the position vector for this point.

Now, represent any point on the plane as \[\vec{r}=(x,y,z)\]. Utilising the fact that \[\vec{u}\] and \[\vec{v}\] span the plane, the displacement vector between \[\vec{r_{0}}\] and \[\vec{r}\], \[\Delta \vec{r}=\vec{r}-\vec{r_{0}}\] must be a sum of some scalar multiple of \[\vec{u}\] and \[\vec{v}\], i.e. \[(x,y,z)-(x_{0},y_{0},z_{0})=s \vec{u}+t \vec{v}\].

Formally, we define a plane \[\Sigma=\left\{ (x,y,z)=(x_{0},y_{0},z_{0})+s\vec{u}+t\vec{v}\mid s,t\in \mathbb{R} \right\}\]. This is known as the parametric equation of the plane.

Vector form

image001-2.png
We can represent the equation above in a more elegant manner, i.e. in the format of \[ax+by+cz=d\].

First, we need to find a vector normal to the plane. Assuming we are given the two vectors that span the plane. Since both \[\vec{u}\] and \[\vec{v}\] are parallel to our plane, the cross product \[\vec{u}\times \vec{v}=\vec{n}\] will give us a resultant vector that is orthogonal to our plane.

Alternatively, if we're know three points on a plane, \[P_{1},P_{2},P_{3}\dots\], we can form two vectors that spans the plane by taking the displacement vector between the three points (any combination will work). Then repeat the process explained above, e.g. \[\vec{n}=(P_{2}-P_{1})\times (P_{3}-P_{1})\].

Now, we know a point on the plane, \[P_{0}=(x_{0},y_{0},z_{0})\] and we have obtained a vector, \[\vec{n}=(a,b,c)\] that is orthogonal to the plane. Let \[P=(x,y,z)\] be any point on the plane. Reusing the notation above, let \[\vec{r_{0}}\] and \[\vec{r}\] be the position vector for \[P_{0}\] and \[P\] respectively. Define a direction vector \[\vec{r}-\vec{r_{0}}\], which naturally is guaranteed to be parallel to the plane. Since the normal vector is perpendicular to any vector that is parallel to the plane, we can use a property of dot product, \[\vec{n}\cdot \left( \vec{r}-\vec{r_{0}} \right)=0\].

We then substitute the values into the equation,

\begin{align*} \vec{n}\cdot(\vec{r}-\vec{r_{0}})&=0\\ &=\left( a,b,c \right)\cdot \left( \left( x,y,z \right)-(x_{0},y_{0},z_{0}) \right)\\ &=\left( a,b,c \right)\cdot \left( x-x_{0},y-y_{0},z-z_{0} \right) \end{align*}

Then, computing the dot product gives us \[a(x-x_{0})+b(y-y_{0})+c(z-z_{0})=0\]. Let \[d=ax_{0}+by_{0}+cz_{0}\], to obtain the equation \[ax+by+cz=d\]. This is known as the equation for a plane.

We can exploit another property of dot products, i.e. \[\vec{n}\cdot(\vec{r}-\vec{r_{0}})=\vec{n}\cdot \vec{r}-\vec{n}\cdot \vec{r_{0}}\implies \vec{n}\cdot \vec{r}=\vec{n}\cdot \vec{r_{0}}\]. Expanding this equation gives us \[ax+by+cz=ax_{0}+by_{0}+cz_{0}=d\] which matches our equation above.

Parallel and perpendicular

If a plane is parallel to a line, the normal of the plane will be perpendicular to the direction of the line, i.e. the dot product will be zero. If it a plane is perpendicular to a line, the direction of the line must be a scalar of the normal vector of the plane.

If a plane is parallel to a plane, the normals of each plane are parallel too, thus must be a scalar multiple of the other. If a plane is perpendicular to another plane, then the normal vectors of both planes must be perpendicular, thus their dot product must be zero.

If a line is parallel to a line, then its direction must be a scalar multiple of the other line as they are parallel directions. If a line is perpendicular to a line, then their directions must be perpendicular, thus their dot product is zero.

Distance between a point and a line

20250421-010952.png
Let \[L\] be a line and \[M\] be any point not on the line. We define distance \[d\] as the perpendicular distance from \[M\] to \[L\].

20250421-011207.png
However, since there is no clear way to know which point on the line creates such a perpendicular line segment, we select some point on the line, call it \[P\]. Let \[\vec{v}\] be the direction vector for \[L\]. Then, vector \[\overrightarrow{PM}\] and \[\vec{v}\] form two sides of a parallelogram, which we can then calculate its area with the cross product \[\left\lVert \overrightarrow{PM}\times \vec{v} \right\rVert\]. Notice that the area of a parallelogram can also be calculated via base times height, i.e. \[\left\lVert \vec{v} \right\rVert d\]. Then, \[\left\lVert \overrightarrow{PM}\times \vec{v} \right\rVert=\left\lVert \vec{v} \right\rVert d\implies d=\frac{\left\lVert \overrightarrow{PM}\times \vec{v} \right\rVert}{\left\lVert \vec{v} \right\rVert}\].

For instance, assuming we have point \[M=(1,1,3)\] and a line with a known point \[P=(3,-1,3)\] and direction vector \[\vec{v}=(4,2,1)\]. Then, \[\overrightarrow{PM}=(1-3, 1-(-1), 3-3)=(-2,2,0)\]. Calculating the cross product \[\overrightarrow{PM}\times \vec{v}=2 \hat{\imath}+2\hat{\jmath}-12\hat{k}\].

Therefore, the distance between the point and the line is \[d=\frac{\sqrt{2^{2}+2^{2}+(-12)^{2}}}{\sqrt{4^{2}+2^{2}+1^{2}}}=\frac{2 \sqrt{798}}{21}\].

Finding the equation of a plane given a point and a line

Assume point \[(1,4,3)\] lies on a plane, and the plane contains the line given by \[x=\frac{y-1}{2}=z+1\]. First, converting the equation of the line, we get \[x=t,\frac{y-1}{2}=t,z+1=t\], then \[(x,y,z)=(t,2t+1,t-1)=(0,1,-1)+t(1,2,1)\].

Now, with two known points and a line, we can simply take the direction vector between the two known points, i.e. \[\vec{v}_{2}=(1-0,4-1,3-(-1))=(1,3,4)\], and calculate the cross product of that and the direction vector of the line to get the normal of the plane. \[\vec{n}=(1,2,1)\times(1,3,4)=(5,-3,1)\].

Then, the equation of the plane would be \[(5,-3,1)\cdot ((x,y,z)-(1,4,3))=5x-3y+z+4\], or \[5x-3y+z=-4\].

Distance between a point and a plane

20250421-020647.png
Let \[P\] be a point. We're interested in finding its perpendicular distance, \[d(P,\Sigma)\], from the plane \[\Sigma\]. Let \[R\] be the point on the plane such that \[\overrightarrow{RP}\] is orthogonal to the plane, \[Q\] be some arbitrary point on the plane. Then, the projection of vector \[\overrightarrow{QP}\] onto the normal vector, \[\vec{n}\] of the plane is equivalent to magnitude of the vector \[\overrightarrow{RP}\]. Then, \[d(P,\Sigma)=\left\lVert \text{proj}_{\vec{n}}\overrightarrow{QP} \right\rVert=\frac{\left| \overrightarrow{QP}\cdot \vec{n} \right|}{\left\lVert \vec{n} \right\rVert}\] (here we take the absolute value of the dot product as we are not interested in its direction).

Assume we have a point \[P=(3,1,2)\] and a plane given by \[x-2y+z=5\]. The equation already provides us with the normal vector \[\vec{n}=(1,-2,1)\]. For our \[Q\], any point on the plane would work, set \[y=z=0\], then \[x=5\], which gives us the point \[Q=(5,0,0)\], \[\overrightarrow{QP}=(3-5,1,2)=(-2,1,2)\]. \[d=\frac{\left| (-2,1,2)\cdot(1,-2,1) \right|}{\sqrt{1^{2}+(-2)^{2}+1^{2}}}=\frac{\left| -2-2+2 \right|}{\sqrt{6}}=\frac{2}{\sqrt{6}}\].

Distance between two parallel planes

Note: Non-parallel planes have distance 0 because they must intersect.

Similar to calculating the distance between a point and a line, assuming we know a point on plane \[\Pi_{1}\], \[(x_{1},y_{1},z_{1})\], and a point on plane \[\Pi_{2}\], \[(x_{2},y_{2},z_{2})\]. Let \[P=(x_{1},y_{1},z_{1})\], \[Q=(x_{2},y_{2},z_{2})\] and \[\vec{n}\] be normal vector of \[\Pi_{2}\], then \[d=\frac{\left| \overrightarrow{QP}\cdot\vec{n} \right|}{\left\lVert \vec{n} \right\rVert}=\frac{\left| (x_{1}-x_{2},y_{1}-y_{2},z_{1}-z_{2})\cdot \vec{n} \right|}{\sqrt{a^{2}+b^{2}+c^{2}}}\].

Assume we have two planes given by \[2x+y-z=2\] and \[2x+y-z=8\]. With these two equations, if we both substitute \[y=z=0\], we know that the point \[(1,0,0)\] and \[(4,0,0)\] and the normal for second plane is \[(2,1,-1)\]. \[d=\frac{\left| 2(1-4)+1(0-0)+(-1)(0-0) \right|}{\sqrt{2^{2}+1^{2}+(-1)^{2}}}=\frac{6}{\sqrt{6}}\].

Line of intersection between two planes

Assume we have the equation for two planes, \[x+2y+z=1\] and \[2x+3y-2z=-2\]. From these equations we know that the normal for both these planes are \[\vec{n}_{1}=(1,2,1)\] and \[\vec{n}_{2}=(2,3,-2)\]. The line of intersection between these two planes must be orthogonal to both these normal vectors.

Therefore, taking the cross product of \[\vec{n}_{1}\times \vec{n}_{2}=(-7,4,1)\], we get the direction of the line of intersection. Then, to find a point on the line, we utilize the fact that the line lies on both planes, thus we solve the system of linear equations \[x+2y+z-1=0\] and \[2x+3y-2z+2=0\].

As long as the line isn't parallel to any of the coordinate axis, we can try setting \[z=0\] (we can even set \[x\], \[y\], \[z\] to any arbitrary number it does not matter), then \[x+2y=1\] and \[2x+3y=-2\]. Solving this we get \[x=-7\] and \[y=4\], which tells us that point \[(-7,4,0)\] lies on the line.

Finally, combining our point and direction vector we get our equation of line of intersection as \[(x,y,z)=(-7,4,0)+t(7,-4,1)\].

Intersecting planes

20250413-031410.png
Suppose we are given two intersecting planes with angle \[\theta\] between them. Let \[\vec{n_{1}}\] and \[\vec{n_{2}}\] be normal vectors to these planes. Then, using cross product, \[\vec{n_{1}}\cdot \vec{n_{2}}=\left\lVert \vec{n_{1}} \right\rVert \left\lVert \vec{n_{2}} \right\rVert\cos\theta\implies \frac{\vec{n_{1}}\cdot \vec{n_{2}}}{\left\lVert \vec{n_{1}} \right\rVert \left\lVert \vec{n_{2}} \right\rVert}=\cos\theta\], allowing us to easily solve for \[\theta\].

Intersection between line and plane

Assuming we have a line with equation \[(x,y,z)=(2,1,0)+t(-1,1,3)\] and a plane with equation \[3x-2y+z=10\]. Now, the trick here convert the line into its parametric equation form and find \[t\] (i.e. it only exists if they intersect).

The parametric equation of the line can be found by comparison, i.e. \[(x,y,z)=(2-t,1+t,3t)\implies x=2-t,y=1+t,z=3t\]. Substituting this into the plane equation, we get \[3(2-t)-2(1+t)+3t=10\], then solving for \[t\] we get \[t=-3\]. Plugging the \[t\] into our line equation, we find that the line and plane intersects at \[(5,-2,-9)\].

What if they never intersect? Assume we have the line \[(x,y,z)=(1,-2,-1)+t(2,3,4)\] and the plane \[x+2y-2z=5\]. Repeat the process similar as the above to get \[(1+2t)+2(-2+3t)-2(-1+4t)=5\]. After expanding and cancelling everything it leaves us with the contradiction \[-1=5\]. This is obviously false. Therefore, we can conclude that since there is no value of \[t\] that can make the equation true, this line does not intersect with this plane.

Also, notice that if we took the dot product between the direction of the line, \[(2,3,4)\] and the normal of the plane, \[(1,2,-2)\], we get \[(2,3,4)\cdot(1,2,-2)=0\]. This is because for a line to never intersect with a plane, it must be parallel to the plane, or by extension, orthogonal to the normal of the plane.

Shortest distance between two skew lines

20250426-030506.png
Assume we have two lines given by \[L_{1}=(-2,1,-1)+t(2,3,-1)\] and \[L_{2}=(1,-1,2)+s(-1,2,4)\]. Then, the vector representing the shortest distance between these two lines must be must be orthogonal to both these lines.

First we convert our lines into \[L_{1}=(-2+2t,1+3t,-1-t)\] and \[L_{2}=(1-s,-1+2s,2+4s)\]. Then, let \[P_{1}\] and \[P_{2}\] represent the two closest points, we can then form our vector \[\overrightarrow{P_{1}P_{2}}=((1-s)-(-2+2t),(-1+2s)-(1+3t),(2+4s)-(-1-t))\]. Since we know this vector must be orthogonal to both \[L_{1}\] and \[L_{2}\], \[((3-s-2t),(-2+2s-3t),(3+4s+t))\cdot(2,3,-1)=0\] and \[((3-s-2t),(-2+2s-3t),(3+4s+t))\cdot(-1,2,4)=0\]. Expanding these two dot product equations, we get \[t=-\frac{3}{14}\] and \[s=-\frac{5}{21}\]. With this, can find the exact points of \[P_{1}\] and \[P_{2}\]. Finally, substitute \[t\] and \[s\] into \[\overrightarrow{P_{1}P_{2}}\] then finding \[\left\lVert \overrightarrow{P_{1}P_{2}} \right\rVert\] and we will get \[\frac{11 \sqrt{6}}{6}=\frac{11}{\sqrt{6}}\].

A much simpler method is to find the normal (direction perpendicular to both lines), \[\vec{n}\] for these two lines, i.e. \[(2,3,-1)\times(-1,2,4)=(14,-7,7)\]. Then take the two known points provided in the line equations to find the vector representing the distance between two points, \[\overrightarrow{R_{1}R_{2}}=(1-(-2),-1-1,2-(-1))=(3,-2,3)\]. Finally, find the magnitude of the vector projection of \[\overrightarrow{R_{1}R_{2}}\] onto \[\vec{n}\], \[\left\lVert \text{proj}_{\vec{n}}\overrightarrow{R_{1}R_{2}} \right\rVert=\frac{\overrightarrow{R_{1}R_{2}}\cdot \vec{n}}{\left\lVert \vec{n} \right\rVert}=\frac{77}{7\sqrt{6}}=\frac{11}{\sqrt{6}}\] as detailed in vector projection.

Equation for common perpendicular between two lines

As an extension of what we've done just now, to find the common perpendicular between two lines, we must first find the points of shortest distance between the two skew lines, then it's simply just doing \[\vec{r}=P+t \vec{n}\], where \[P\] can be either \[P_{1}\] or \[P_{2}\] and \[\vec{n}\] is the normal/direction perpendicular to both lines. Or, if we already have both \[P_{1}\] and \[P_{2}\] we don't even need to bother finding \[\vec{n}\] as \[\overrightarrow{P_{1}P_{2}}\] would suffice, because it must be parallel to \[\vec{n}\].

Referenced by:

No backlinks found.

index