es
Although the topic of this section is related to affine geometry, it helps the reader to appreciate the geometrical ideas underlying and motivating linear algebra. We do not discuss practical applications of drawing lines in multidimensional spaces, instead we refer to famous Bresenham's and Wu's algorithms for accomplishing this task.

# Lines and Planes

Lines in ℝ²

Lines in ℝ² can be explicitly described in either parametric or Cartesian form.
Theorem 1: The following sets are lines in ℝ².
1. Lp = { p + tw : t∈ℝ} with p, w ∈ ℝ² and w0     (parametric form)
2. Lc = { x ∈ ℝ² : nx = b } with n ∈ ℝ², b ∈ ℝ, n0     (Cartesian form).
Here n = (n₁, n₂) is a normal vector for the line, and dot "•" stands for the dot product, nx = nx₁ + nx₂. Instead of dot product, this form can also be written as y = m x + b for some real m, b ∈ ℝ.
Every line can be written in the form (i) or (ii). If nw (so nw = 0) and b = np, then Lp = Lc.
First, we show the equality, Lp = Lc, under the stated conditions.
LpLc : Start with an element x = p + twLp. Multiply this equation with n (keeping in mind that nw = 0) leads to nx = np = b, which shows that xLc.
LcLp : Conversely, consider an element xLc, which by definition, satisfies nx = b. Given that b = np, this equation can be re-written as n • (xp) = 0. Every vector xp can be represented as a linear combination xp = cn + tw (since (n, w), as two non-zero orthogonal vectors, form a basis of ℝ²). From 0 = n • (xp) = c |n|², we conclude that cx = p + twLp.

It is clear that every line p + W can be written in parametric form by choosing a non-zero vector w ∈ ℝ² such that W = span(w). Conversely, every parametric form defines a line by setting W = span(w).

To complete the proof, we show that every line in parametric form can be converted into Cartesian form and vice versa. To see the former, start with vectors p, w defining a parametric line Lp. Setting n so that nw, and b = np defines a line in Cartesian form with Lc = Lp. If we start with the Cartesian line Lc, specified by n and b, then setting w = n and choosing p to be any solution of np = b, we get a parametric line Lp with Lp = Lc.

The geometric interpretation of the various vectors which enter the parametric and Cartesian form is indicated in the following figure.

 Line in ℝ² with parametric form Figure 11.1, Oxford, page 120 code:

For the parametric form, x(t) = p + tw, the vector p is a vector ’to the line’ and the vector w a vector ’along the line’. For the Cartesian form nx = b, the vector n is a vector orthogonal to the line while |b|/|n| is the minimal distance of the line from the origin. To verify the last statement, write the parametric form of a line as $|{\bf n}| \, |{\bf x}| \,\cos\left( \angle ({\bf n}, {\bf x}) \right) = b .$ The value of |x| is minimal when |cos(∢(n, x))| takes its maximal value which is, of course, |cos(∢(n, x)) = 1. It follows that the minimal value of |x| is indeed |b|/|n|.

We should stress that neither the parametric nor the Cartesian form of a line is unique, that is, one and the same line can be described by different equations of this form. For example, in the parametric form we can use instead of w any non-zero multiple βw or, instead of p any other vector p + αw to the line. For the Cartesian form, using αn and αb instead of n and b describes the same line. Theorem 1 indicates a method to convert a line in parametric form to Cartesian form and vice versa. It is worth practicing this by looking at examples.

Example 1: Let us consider the line 2y = x. Any point (x, y) on this line must satisfy equation, and all points that satisfy the equation are on this line.

 Line in ℝ² Figure code:

Another way to describe the points on the line is by giving their position vectors. We can let x = t, where t is any real number. Then y is determined by y = x/2 = t/2. So x = (x, y) is the position vector of a point on the line, then
${\bf x} = \begin{pmatrix} 2t \\ t \end{pmatrix} = t \begin{pmatrix} 2 \\ 1 \end{pmatrix} = t{\bf w} , \qquad t \in \mathbb{R} .$
For example, if t = 2.5, we get the position vector of the point (5, 2.5) on the line, and if t = −2, we obtain the point (−4, −2). As the parameter t runs through all real numbers, this vector equation gives the position vectors of all the points on the line.

Starting with the parametric vector equation ${\bf x} = \begin{pmatrix} x \\ y \end{pmatrix} = t{\bf w} = t \begin{pmatrix} 2 \\ 1 \end{pmatrix} , \qquad t \in \mathbb{R} ,$ we can retrieve the Cartesian equation using the fact that the two vectors are equal if and only if their components are equal. This gives us the two equations x = 2t and y = t. Eliminating the parameter t between these two equations yields 2y = x.

End of Example 1
Example 2: Consider the line 2y = x + 3. Proceeding as above, we set x = t, t ∈ &reals. Then 2y = x + 3 = t + 3, so the position vector of a point on the line is given by the parametric form
${\bf x} = \begin{pmatrix} 2t \\ t+3 \end{pmatrix} = \begin{pmatrix} 0 \\ 3/2 \end{pmatrix} + t \begin{pmatrix} 2 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 2 \end{pmatrix} + s \begin{pmatrix} 2 \\ 1 \end{pmatrix}, \qquad t,s \in \mathbb{R} .$
We convert this line into Cartesian form by setting p = (0, 3/2), w = (2, 1), and x = (x, y). We choose n so that nw = 0; for instance, let n = (−1, 2), then nw. Hence, b = np = 3, and the Cartesian form of the line becomes
${\bf x} \bullet \begin{pmatrix} -1 \\ \phantom{-}2 \end{pmatrix} = 3 \qquad\mbox{or} \qquad 2y-x = 3 .$
Its minimal distance from the origin is |b|/|n| = 3/√5.
End of Example 2
Example 3: A line in Cartesian form is given by 3x −5y = 4. We can write this equation as nx = b with n = (3, −5), x = (x, y), and b = 4. A vector w along the line is found by w = n = (5, 3). To find a vector p to the line we can use any solution to the Cartesian equation; for example, p = (3, 1). Hence, a parametric form of the line becomes
${\bf x} \bullet \begin{pmatrix} \phantom{-}3 \\ -5 \end{pmatrix} = 4 \qquad\mbox{or} \qquad -5y+3x = 4 .$
We can interpret this equation as follows. To locate any point on the line, first locate one particular point p that is on the line.; for instance, the y intercept (0, −4/5). Then the position vector of any point x on the line is a sum of two displacements, first going to the point on the line p and then going along the line, in a direction parallel to the vector w.
End of Example 3
Example 4: Convert the parametric form ${\bf x}(t) = \begin{pmatrix} 2 \\ 1 \end{pmatrix} + t \begin{pmatrix} \phantom{-}3 \\ -1 \end{pmatrix} \tag{4.1}$ of a line into Cartesian form. Find the minimal distance of the line from the origin.

Solution: With p = (2, 1), w = (3, −1), and x = (x, y), we have n = w = (1, 3) and b = np = 5. Hence, the Cartesian form of the line is $\begin{pmatrix} 1 \\ 3 \end{pmatrix} \bullet {\bf x} = 5 \qquad \mbox{or}\qquad x + 3y = 5.$ Its minimal distance from the origin is $$\displaystyle |b|/\sqrt{|{\bf n}|} = 5\sqrt{3^2 + 1^2} = \sqrt{5/2} \approx 1.58114 .$$

End of Example 4

The intersection of two lines in ℝ² can be discussed using either parametric or Cartesian forms. We opt for the latter and write the equations for the two lines as

$L_1 = \left\{ {\bf x} \in \mathbb{R}^2 \ : \ {\bf n}_1 \bullet {\bf x} = b_1 \right\} , \qquad L_2 = \left\{ {\bf x} \in \mathbb{R}^2 \ : \ {\bf n}_2 \bullet {\bf x} = b_2 \right\} ,$
with intersection
$L_1 \cap L_2 = \left\{ {\bf x} \in \mathbb{R}^2 \ : \ {\bf n}_1 \bullet {\bf x} = b_1 \wedge {\bf n}_2 \bullet {\bf x} = b_2 \right\} .$
Evidently, the intersection L1L2 is determined by the solution to two simultaneous linear equations in two variables. With n1 = (n11, n12), n2 = (n21, n22), and x = (x, y), these equations can also be written as
$n_{11} x + n_{12} y = b_1 , \qquad n_{21} x + n_{22} y = b_2 ,$
or, in matrix-vector form, as Nx = b, where N is a 2 × 2 matrix with entries nij and b = (b1, b2).

We already know from the introduction that there are three possibilities for the solutions to a system of two linear equations in two variables. The solution can be unique, but we can also have an entire line of solutions or there may be no solution at all, depending on the coefficients in the linear equations. In geometrical terms, these three cases correspond to the two lines intersecting in a point, being identical and being parallel.

Lines in ℝ³

It is natural to identify points on a line in ℝ³ in parametric form. Again, we need a point p to pass through and the direction or in the opposite direction. w of the line. Therefore, a line in ℝ³ is given by a vector equation with one parameter,
${\bf x} = {\bf p} + t{\bf w}, \qquad t\in \mathbb{R} ,$
where x is the position vector of any point on the line, p is the position vector of one particular point on the line, and w is the direction of the line, Using Cartesian coordinate, we write line's equation as
$$\label{EqLine.1} {\bf x} = \begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} p_1 \\ p_2 \\ p_3 \end{pmatrix} + t \begin{pmatrix} w_1 \\ w_2 \\ w_3 \end{pmatrix} , \qquad t\in \mathbb{R} .$$
Theorem 2: The following sets are lines in ℝ³.
1. Lp = { p + tw : t ∈ ℝ } with p, w ∈ ℝ³ and w0.
2. Lc = { x ∈ ℝ³ : n₁ • x = b₁, n₂ • x = b₂ }
with n₁, n₂ linearly independent, b₁, b₂ ∈ ℝ.
All lines in ℝ³ can be written in the form (i) and (ii). If {w, n₁, n₂} is a basis of mutually orthogonal vectors and b₁ = n₁ • p, b₂ = n₂ • p, then Lp = Lc.
We begin by showing the equality of the two sets. LpLc : Start with x = p + twLp. Multiplying this equation with n₁ and n₂ gives n₁ • x = n₁ • p = b₁ and n₂ • x = n₂ • p = b₂. Therefore, xLc.

LcLp : A vector xLc satisfies nix = bi, or, equivalently, ni • (xp) = 0 for i = 1, 2. We can write the vector xp as a linear combination of the basis {w, n>₁, n>₂}, so xp = tw + α₁n>₁ + α₂n>₂. It follows that

$0 = {\bf n}_i \bullet \left( {\bf x} - {\bf p} \right) = {\bf n}_i \bullet \left( t{\bf w} + \alpha_1 {\bf n}_1 + \alpha_2 {\bf n}_2 \right) = \alpha_i \vert {\bf n}_i \vert^2$
and hence αi = 0 for i = 1, 2. Therefore, x = p + twLp.

Clearly, every line p + W can be written in parametric form by choosing a vector w, then W = Span(w); conversely, every parametric form given a line with W = Span(w).

Given a parametric line Lp, specified by vectors p, w, we can find mutually orthogonal vectors w, n₁, n₂. Then n₁, n₂ along with b₁ = n>₁ • p and b₂ = n₂ • p define a Cartesian line Lc with Lc = Lp.

Conversely, let Lc be a Cartesian line specified by n₁, n₂ and b₁, b₂. Define w = n₁ × n₂. We can always find a solution p to the equations n₁ • p = b₁ and n₂ • p = b₂. Then w and p define a parametric line Lp with Lp = Lc.

Example 5: The equations
${\bf x} = \begin{pmatrix} 2 \\ 5 \\ 3 \end{pmatrix} + t \begin{pmatrix} \phantom{-}1 \\ \phantom{-}2 \\ -1 \end{pmatrix} \qquad \mbox{and} \qquad {\bf x} = \begin{pmatrix} 0 \\ 1 \\ 5 \end{pmatrix} + s \begin{pmatrix} -3 \\ -6 \\ \phantom{-}3 \end{pmatrix} , \qquad s,t \in \mathbb{R} ,$
describe the same line. It is not obvious, so how do we show it?

The lines represented by these equations are parallel since their direction vectors are parallel:

$\begin{pmatrix} -3 \\ -6 \\ \phantom{-}3 \end{pmatrix} = -3 \begin{pmatrix} \phantom{-}1 \\ \phantom{-}2 \\ -1 \end{pmatrix} .$
Hence, they either have no point in common and are parallel, or they have all points in common and are really the same line. Since
$\begin{pmatrix} 2 \\ 5 \\ 3 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \\ 5 \end{pmatrix} + 2 \begin{pmatrix} \phantom{-}1 \\ \phantom{-}2 \\ -1 \end{pmatrix} ,$
the point (2, 5, 3) is on both lines, so they must have all points in common. We say that the lines are coincident.

On the other hand, the lines represented by the equations

${\bf x} = \begin{pmatrix} 2 \\ 1 \\ 3 \end{pmatrix} + t \begin{pmatrix} \phantom{-}1 \\ \phantom{-}2 \\ -1 \end{pmatrix} \qquad \mbox{and} \qquad {\bf x} = \begin{pmatrix} 0 \\ 1 \\ 5 \end{pmatrix} + s \begin{pmatrix} -3 \\ -6 \\ \phantom{-}3 \end{pmatrix} , \qquad s,t \in \mathbb{R} ,$
are parallel with no points in common since there is no value of s for which
$\begin{pmatrix} 2 \\ 1 \\ 3 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \\ 5 \end{pmatrix} + s \begin{pmatrix} -3 \\ -6 \\ \phantom{-}3 \end{pmatrix} , \qquad s,t \in \mathbb{R} .$
End of Example 5
We can also describe a line in ℝ³ by Cartesian equations, but this time we need two such equations because there are three variables. Equating components in the vector equation \eqref{EqLine.1}, we have
$x = p_1 + t\,w_1 , \qquad y= p_2 + t\,w_2 , \qquad z= p_3 + t\,w_3 .$
Solving each of these equations for the parameter t and equating the results, we get the two equations
$\frac{x-p_1}{w_1} = \frac{y-p_2}{w_2} = \frac{z- p_3}{w_3} , \qquad \mbox{provided} \quad w_i \ne 0, \quad i=1,2,3.$

The two Cartesian equations for a line, n₁ • x = b₁ and n₂ • x = b₂, can also be written as a linear system N x = b with two equations and three variables, where N is the matrix with entries nij and b = (b₁, b₂). From this point of view, the line is the solution space of the linear system. This is another illustration of the close relation between affine k-planes and linear systems.

Theorem 3: Let L = {p + tw : t ∈ ℝ} ⊂ ℝ³ be a line in parametric form and p₀ ∈ ℝ³. The minimal distance of p₀ from the line arises at tmin = −dw/|w|², where d = pp₀. The minimal distance is given by dmin = |d × w|/|w|.
We simply work out the distance square d²(t) = |xp₀|² of an arbitrary point x(t) = p + tw on the line from the point p₀. This leads to
\begin{align*} d^2 (t) &= \left\vert {\bf d} + t{\bf w} \right\vert^2 = |{\bf w}|^2 t^2 + 2 \left( {\bf d} \bullet {\bf w} \right) t + |{\bf d}|^2 \\ &= \left[ |{\bf w}| + \frac{{\bf d} \bullet {\bf w}}{|{\bf w}|} \right]^2 + |{\bf d}|^2 - \frac{\left( {\bf d} \bullet {\bf w} \right)}{|{\bf w}|^2} . \end{align*}
This is minimal when the expression inside the square bracket vanishes which happens for t = tmin = −dw/|w|²'. This proves the first part of the claim. For the second part we simply compute the distance at tmin, which gives
$d^2_{min} := d^2 \left( t_{min} \right) = \frac{1}{|{\bf w}|^2} \left( |{\bf d}|^2 |{\bf w}|^2 - \left( {\bf d} \bullet {\bf w} \right)^2 \right) = \frac{|{\bf d} \times {\bf w} |^2}{|{\bf w}|^2} .$
Example 6: To find Cartesian equation of the line
${\bf x} = \begin{pmatrix} 3 \\ 2 \\ 1 \end{pmatrix} + t \begin{pmatrix} \phantom{-}2 \\ -1 \\ \phantom{-}0 \end{pmatrix} , \qquad t \in \mathbb{R} ,$
we equate components:
$x = 3 + 2t, \qquad y = 2 -t, \qquad z= 1.$
Next, we solve for t the first and the second equation that lead to the Cartesian form :
$\frac{x-3}{2} = 2-y \qquad \mbox{and} \qquad z = 1.$
This is a line parallel to the xy-plane in ℝ³. The direction vector has a zero in the third component, so there is no change in the z direction: the z coordinate has the constant value z = 1.
End of Example 6
In ℝ², two lines are either parallel or intersect in unique point. In ℝ³, more can happen. Two lines in ℝ³ either intersect in a unique point, are parallel or are skew, which means that they do not intersect and are not parallel.

One way to imagine skew lines is to look around: do you see ceiling and floor? Now draw one line on the ceiling and another one on the floor. Most likely they will be skewed because it is difficult to plot them parallel. You can also draw two skew lines on two walls or a wall and a floor.

Two lines are said to be coplanar if they lie in the same plane, in which case they are either parallel or intersecting.
A parametric form of a given line is not unique: we can in fact change the point p = (p₁, p₂, p₃) used in the representation \eqref{EqLine.1}, choosing it arbitrarily among all the infinite points of the line, or we can multiply the parameter t for an arbitrary nonzero constant: in both the cases the line does not change, even though its parametric equations can take a different form.
Example 7: Let us consider two lines written in parametric form:
$L_1 \ : \quad \left[ \begin{array}{c} x \\ y \\ z \end{array} \right] = \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} + t \begin{pmatrix} \phantom{-}4 \\ \phantom{-}2 \\ -2 \end{pmatrix} , \qquad t \in \mathbb{R} ,$
and
$L_2 \ : \quad \left[ \begin{array}{c} x \\ y \\ z \end{array} \right] = \begin{pmatrix} 3 \\ 4 \\ 5 \end{pmatrix} + t \begin{pmatrix} -2 \\ -1 \\ \phantom{-}1 \end{pmatrix} , \qquad t \in \mathbb{R} .$
These two lines L₁ and L₂ have the same direction, since the direction vector of the first line (4, 2, −2) is a multiple of another one, (−2, −1, 1). Therefore, the two lines are parallel or they coincide. To establish their mutual positions, it is sufficient to check if the starting point p = (1, 2, 3) of the first line belongs to the line L₂, so we need to check whether there exists t such that
$\begin{cases} 1 &= 3 -2t \qquad \Longrightarrow \qquad t = 1, \\ 2 &= 4 -t \qquad \Longrightarrow \qquad t = 2, \\ 3 &= 5 +t \qquad \Longrightarrow \qquad t = -2 . \end{cases}$
Therefore, we conclude that the given lines L₁ and L₂ are parallel.

Let us convert parametric equations of lines L₁ and L₂ into Cartesian form. Excluding t form equations of L₁, we get

$t = \frac{x-1}{4} = \frac{y-2}{2} = \frac{z-3}{-2}$
This yields
$\begin{cases} x &= 2y -3 , \\ y &= -z +5 . \end{cases}$
Similarly for L₂, we have
$t = \frac{x-3}{-2} = \frac{y-4}{-1} = \frac{z-5}{1} \qquad \Longrightarrow \qquad \begin{cases} x &= 2y - 5 , \\ y &= -z +9 . \end{cases}$
End of Example 7
Example 8: Let us consider two lines written in parametric form:
$L_1 \ : \quad \left[ \begin{array}{c} x \\ y \\ z \end{array} \right] = \begin{pmatrix} \phantom{-}1 \\ \phantom{-}0 \\ -1 \end{pmatrix} + t \begin{pmatrix} \phantom{-}2 \\ \phantom{-}1 \\ -1 \end{pmatrix} , \qquad t \in \mathbb{R} ,$
and
$L_2 \ : \quad \left[ \begin{array}{c} x \\ y \\ z \end{array} \right] = \begin{pmatrix} \phantom{-}3 \\ -1 \\ \phantom{-}2 \end{pmatrix} + t \begin{pmatrix} \phantom{-}1 \\ \phantom{-}2 \\ -1 \end{pmatrix} , \qquad t \in \mathbb{R} .$
First, we check whether these two lines intersect at a point. To answer this question, we substitute the position vector p = (1, 0 , −1) into the equation of the second line. This leads to the system of linear equations
$\begin{cases} 1 &= 3 +t \qquad \Longrightarrow \qquad t = -2, \\ 0 &= -1 + 2t \qquad \Longrightarrow \qquad t = 1/2 , \\ -1 &= 2 -t \qquad \Longrightarrow \qquad t = 3 . \end{cases}$
Hence, these two lines L₁ and L₂ do not intersect.

Next, we convert their parametric equations into Cartesian ones:

$L_1 \ : \quad t = \frac{x-1}{2} = y = \frac{z+1}{-1} ,$
and
$L_2 \ : \quad t = \frac{x-3}{1} = \frac{y+1}{2} = \frac{z-2}{-1} ,$
Hence,
$L_1 \ : \quad \begin{cases} x - 2y &= 1 , \\ y + z &=-1; \end{cases}$
and
$L_2 \ : \quad \begin{cases} 2x -y &= 7 , \\ y + 2z &= 3. \end{cases}$
End of Example 8

Planes in ℝ³

On a line, there is essentially one direction in which a point can move, given as all possible scalar multiples of a given direction, but on a plane there are more possibilities. A point can move in two different directions, and in any linear combination of these two directions.

Planes are sets of the form P = p + W ⊂ ℝ³, where p ∈ ℝ³ and W ⊂ ℝ³ is a two-dimensional vector subspace.

Remove[ "Global*"] (* remove all variables *)
a := 3; b := 1; c := 5; x0 := -2; y0 := 1; z0 := 3; F[x_, y_] := (a x0 + b y0 + c z0 - a x - b y)/c; planePlot1 = Plot3D[F[x, y], {x, -2, 5}, {y, -2, 10}, PlotStyle -> Opacity[0.2], PlotRange -> {{-2, 8}, {-2, 13}, {-4, 9}}, AxesLabel -> {x, y, z}]; coordAxes = Graphics3D[{ Red, Line[{{-2, 0, 0}, {6, 0, 0}}], Text["x", {7, 0, 0}], Red, Line[{{0, -3, 0}, {0, 12, 0}}], Text["y", {0, 13, 0}], Red, Line[{{0, 0, -3}, {0, 0, 8}}], Text["z", {0, 0, 8.5}] }]; Show[planePlot1, coordAxes, ViewPoint -> {1.9655766612490726, -2.69731562532161, 0.5576708761884621} (*,ViewPoint->{-0.053311754531831235,-3.3776617046598956,0.\ 19636513362284191}*)]

=========== to be checked =============

Show[planePlot1, coordAxes ViewPoint -> {1.9655766612490726, -2.69731562532161, 0.5576708761884621}*) , ViewPoint -> {-0.053311754531831235, -3.3776617046598956, 0.19636513362284191`}]

=============================================

Clear[a, b, c, d, x0, y0, z0, v, w, k, q, r, s] a := 3; b := -1; c := 0; x0 := 1; y0 := 3; z0 := 2; d := {a, b, c}.{x0, y0, z0}; planePlot2 = ParametricPlot3D[{u, (d - a u)/b, v}, {u, -4, 4}, {v, -2, 8}, PlotStyle -> Opacity[0.2], AxesLabel -> {x, y, z}]
Theorem 4: The following sets are planes in ℝ³.
1. Pp = { p + tw₁ + sw₂ : t, s ∈ ℝ }
with p ∈ ℝ³ and w₁, w₂ ∈ ℝ³ are linearly independent;
2. Pc = { x ∈ ℝ³ : nx = b }
with n ∈ ℝ³ nonzero, b ∈ ℝ.
Every plane can be written as in (i) or (ii). If nw₁, w₂ and b = pn, then Pp = Pc.
As in theorem 1, we begin by showing that Pp = Pc under the stated conditions.
PpPc : For a vector x = p + tw₁ + sw₂, take the dot product with n, keeping in mind that nw₁ = nw₂ = 0. This leads to nx = np = b, so that xPc.

PcPp : Start with a vector xPc, so that nx = b, or, equivalently, n • (xp) = 0. To solve this last equation we first note that {n, w₁, w₂} forms a basis of ℝ³. This means that we can write every vector xp as a linear combination xp = cn + tw₁ + sw₂. From 0 = n • (xp) = c|n|², it follows that c = 0 and, hence, x = p + tw₁ + sw₂ ∈ Pp.

Every plane p + W can be written in parametric form by choosing a basis {w₁, w₂} of W. Conversely, a parametric form with w₁, w₂ defines a plane by setting W = span(w₁, w₂).

Every plane in parametric form can be converted into Cartesian form. Start with vectors p, w₁, w₂, specifying a parametric plane Pp. Setting n = w₁ × w₂ and b = pn defines a Cartesian plane Pc with Pc = Pp.

On the other hand, for a Cartesian plane Pc, specified by n and p, we can find mutually orthogonal vectors {n, w₁, w₂} together with any solution of p of np = b defines a parametric plane Pp with Pp = Pc.

In the parametric form, p is a vector ’to the plane’ while w₁ and w₂ are vectors ’along the plane’. For the Cartesian form, n is a vector orthogonal to every vector in the plane and |b|/|n| is the minimal distance of the plane from the origin.
Example 9: Convert the plane with parametric form
${\bf x} (t,s) = \begin{pmatrix} \phantom{-}1 \\ -2 \\ \phantom{-}1 \end{pmatrix} + t \begin{pmatrix} \phantom{-}2 \\ -1 \\ \phantom{-}3 \end{pmatrix} + s \begin{pmatrix} \phantom{-}1 \\ -2 \\ \phantom{-}0 \end{pmatrix} , \qquad t,s \in \mathbb{R} ,$
into Cartesian form. Find the minimal distance of the plane from the origin.

With p = (1, −2, 1), w₁ = (2, −1, 3) and w₂ = (1, −2, 0) we have

${\bf n} = {\bf w}_1 \times {\bf w}_2 = \begin{pmatrix} \phantom{-}2 \\ -1 \\ \phantom{-}3 \end{pmatrix} \times \begin{pmatrix} \phantom{-}1 \\ -2 \\ \phantom{-}0 \end{pmatrix} = \begin{pmatrix} \phantom{-}6 \\ \phantom{-}3 \\ -3 \end{pmatrix}$
Cross[{2, -1, 3}, {1, -2, 0}]
{6, 3, -3}
and b = np = (6, 3, −3) • (1, −2, 1) = −3 . Hence, with x = (x, y, z), a Cartesian form of the pane becomes
$\begin{pmatrix} \phantom{-}6 \\ \phantom{-}3 \\ -3 \end{pmatrix} \bullet {\bf x} = -3 \qquad\mbox{or} \qquad 6x + 3y - 3z = -3 .$
The minimal distance from the origin is |b|/|n| = 1/√6 ≈ 0.408248.
N[1/Sqrt[6], 12]
0.408248290464
End of Example 9
Example 10: Let us consider the plane x − 3y + 2z = 4. We identify a normal vector to the plane as n = (1, −3, 2) and b = 4. Upon setting x = (x, y, z), the plane equation can be written in the Cartesian standard form nx = b. As a vector p ’to the plane’ we can use any vector that satisfies np = b = 4; for example, p = (2, 0, 1). To get two vectors w₁, w₂ ’in the plane,’ we need two linearly independent solutions to nx = 0; for example, w₁ = (1, 1, 1) and w₂ = (3, 2, 1). Hence, a parametric form of the plane becomes
${\bf x} (s, t) = {\bf p} + s{\bf w}_1 + t {\bf w}_2 = \begin{pmatrix} 2 \\ 0 \\ 1 \end{pmatrix} + s \begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix} + t \begin{pmatrix} 3 \\ 2 \\ 1 \end{pmatrix} .$
End of Example 10
Theorem 5: Suppose that an equation of a plane is given in either in Cartesian form by nx = b or in parametric form by x(t, s) = p + tw₁ + sw₂. The minimal distance of the plane from p₀ ∈ ℝ³ is given by $$\label{EqLine.2} d_{\min} = \frac{\left\vert b - {\bf n} \bullet {\bf p}_0 \right\vert}{|{\bf n}|} = \frac{|{\bf d} \bullet \left( {\bf w}_1 \times {\bf w}_2 \right) |}{|{\bf w}_1 \times {\bf w}_2 |} , \quad {\bf d} = {\bf p} - {\bf p}_0 .$$
We start with the Cartesian form nx = b and subtract np₀, so that n • (pp₀) = bnp₀ or, equivalently, $|{\bf n}| \, \left\vert {\bf x} - {\bf p}_0 \right\vert \cos ∢\left( {\bf n}, {\bf x} - {\bf p}_0 \right) = b - {\bf n} \bullet {\bf p}_0 .$ The value of |np0| is maximal when the (absolute) value of the cosine is 1, so that dmin = |bnp₀|/|n|. This proves the first part of Eq.\eqref{EqLine.2}. For the second part, simple insert the relations n = w₁ × w₂ and b = pn.
Example 11: Find the minimal distance of the plane 3x − 2y + z = 5 from p₀ = (−1, 1, 2).

Solution: The plane is given in Cartesian form nx = b, with n = (3, −2, 1) and b = 5. Inserting np₀ = −3, |n| = √14, and b = 5 into formula \eqref{EqLine.2}, we get

{3, -2, 1}.{-1, 1, 2}
-3
$d_{\min} = \frac{8}{\sqrt{14}} \approx 2.13808993530 .$
End of Example 11

Intersections

Let us consider two planes in Cartesian form
$P_1 = \left\{ {\bf x} \in \mathbb{R}^3 \mid {\bf n}_1 \bullet {\bf x} = b_1 \right\} , \qquad P_2 = \left\{ {\bf x} \in \mathbb{R}^3 \mid {\bf n}_2 \bullet {\bf x} = b_2 \right\} ,$
and their intersection
$L = P_1 \cap P_2 = \left\{ {\bf x} \in \mathbb{R}^3 \mid {\bf n}_1 \bullet {\bf x} = b_1 \wedge {\bf n}_2 \bullet {\bf x} = b_2 \right\} .$
If the two vectors n 1 and n 2 are linearly independent then L is a line, written down in Cartesian form, as comparison with Theorem 2 shows. If n₁ and n₂ are linearly dependent, n₂ = αn₁ for a non-zero α ∈ ℝ, then the equations for the two planes turn into n₁ • x = b₁ and n₁ • x = b₂/α. If αb₁ = b₂, the two planes are identical and their intersection is the entire plane, so L = P₁ = P₂. On the other hand, if αb₁ ≠ b₂, then the planes are parallel and the intersection is empty, L = ∅.
Example 12: Find the intersection of the two planes −x +2y − z = 3 and 3x − 𝑎y + 3z = b for all values of the parameters 𝑎, b ∈ ℝ. If the intersection is a line, find its parametric form.

Solution: We have n₁ = (−1, 2, −1), b₁ = 3 and n₂ = (3, −𝑎, 3), b₂ = b.

(1)   𝑎 ≠ 6. In this case n₁ and n₂ are linearly independent and the intersection must be a line. Withw = n₁ × n₂ = (6 −𝑎, 0, 𝑎 −6)

Cross[{-1, 2, -1}, {3, -aa, 3}]
{6 - aa, 0, -6 + aa}
and a special solution p = (0, 9+ b, 3𝑎 + 2b)/(6−𝑎)
Solve[{-x + 2*y - z == 3, 3*x - aa*y + 3*z == b}, {x, y, z}]
{{y -> -((9 + b)/(-6 + aa)), z -> -((3 aa + 2 b)/(-6 + aa)) - x}}
to the two equations the parametric form of the intersection line is ${\bf x}(t) = \frac{1}{6-a} \begin{pmatrix} 0 \\ 9+b \\ 3a + 2b \end{pmatrix} + t \begin{pmatrix} \phantom{-}1 \\ \phantom{-}0 \\ -1 \end{pmatrix} , \qquad t \in \mathbb{R} .$

(2a)   𝑎 = 6 and b ≠ −9. In this case the two planes are parallel so the intersection is empty.

(2b)   𝑎 = 6 and b = −9. The two planes are identical.

End of Example 12

The intersection of a line and a plane in ℝ³ is easiest discussed with the line in parametric and the plane in Cartesian form, that is

$L = \left\{ {\bf p} + t{\bf w} \mid t \in \mathbb{R} \right\} , \qquad P = \left\{ {\bf x} \in \mathbb{R}^3 \mid {\bf n} \bullet {\bf x} = b \right\} .$
By inserting the parametrization of the line into the equation for the plane we find for the intersection
$L \cap P = \left\{ {\bf p} + t{\bf w} \mid \left( {\bf n} \bullet {\bf w} \right) t = b - {\bf n} \bullet {\bf p} \right\} .$
If nw ≠ 0, then we can solve for t = t₀ = (bnp)/(nw) and the intersection consists of a single point, LP = {p + tw}. On the other hand, ifnw = 0 and bnp, there is no solution for t, so the intersection is empty, LP = { }. For nw = 0 and b = np. every t ∈ ℝ is a solution so that LP = L — the line is a subset of the plane.
Example 13: Find the intersection of the plane with Cartesian equation 2x − 3y + 5z = 7 with the line in parametric form given by ${\bf x} (t) = \begin{pmatrix} \phantom{-}2 \\ -3 \\ \phantom{-}1 \end{pmatrix} + t \begin{pmatrix} -3 \\\phantom{-}2 \\ -1 \end{pmatrix} , \qquad t \in \mathbb{R} .$ With x = (x, y, z), we can split the parametric form of the line into its components x = 2 −3t, y = −3 + 2t, z = 1 −t, and insert these into the equation for the plane. This gives $2 \left( 2 -3t \right) -3 \left( -3 + 2t \right) + 5 \left( 1-t \right) = 7$ Hence, the intersection point is x(11/17) = (1, −29, −28)/17.
End of Example 13

Suppose that we are interested in the intersection P₁ ∩ P₂ ∩ P₃ of the three planes in ℝ³ in Cartesian form:

$P_i = \left\{ {\bf x} \in \mathbb{R}^3 \mid {\bf n}_i \bullet {\bf x} = b_i \right\} , \qquad i=1,2,3.$
This intersection is clearly the same as the solution to the system of the three linear equations in three variables given by nix = bi for i = 1, 2, 3. Another example of the close relationship between the geometry of affine k-planes and linear systems. Of course, the intersection can be found by solving the linear system explicitly. However, the qualitatively different cases which can arise can be easily reasoned out from what we have discussed so far.

Start by considering the intersection P₁ ∩ P₂ of the first two planes. This intersection may be a line, a plane or it may be empty. If L = P₁ ∩ P₂ is a line, then the triple intersection P₁ ∩ P₂ ∩ P₃ = LP₃ can be a point, a line or be empty. This already covers all the cases but one, which is the case P₁ = P₂ = P₃, so that the intersection is a plane.

Example 14: Let us find the intersection of the three planes with Cartesian equations 2xy + 4z = 7, 4xy + z = 1, and 4x + 3y − 5z = 4.

Solve[{2*x - y + 4*z == 7, 4*x - 1*y + z == 1, 4*x + 3*y - 5*z == 4}, {x, y, z}]
{{x -> 3/4, y -> 9/2, z -> 5/2}}

From the first equation, we get y = 2x + 4z −7. Substituting y into two other equation, we obtain the system of two equations:

End of Example 14
Example 15: Artificial neural networks are motivated by the structure of the human brain and they play an important role in modern computing. Many of the operating principles of artificial neural networks can be formulated and understood in terms of linear algebra. Here, we would like to introduce one of the basic building blocks of artificial neural networks — the perceptron.

A Perceptron is a neural network unit that does certain computations to detect features or business intelligence in the input data. It is a function that maps its input “x,” which is multiplied by the learned weight coefficient, and generates an output value ”f(x)."

The structure of the perceptron is schematically illustrated in the figure below.

$\mathbb{R}^n \ni {\bf x} \longrightarrow \fbox{{\bf z} = {\bf w} \bullet {\bf x} - b} \stackrel{z \in \mathbb{R}}{\longrightarrow} \fbox{y = \sigma (z)}\longrightarrow y \in \mathbb{R}$
The perceptron receives an input vector x = (x1, x2, … , xn) ∈ ℝn, which it converts into a real output y ∈ ℝ in two steps. In the first step, it transforms x as
${\bf z} \,\mapsto \,z = {\bf w} \bullet {\bf x} - b ,$
where w ∈ ℝn is called the weight vector of the perceptron and b ∈ ℝ is called the bias. The weight vector and the bias represent the internal state of the perceptron and, for now, we think of them as given quantities. In the second step, the output z from the first step is transformed as $z \mapsto y = \sigma (z) .$ Here, σ is called the activation function and there are several possible choices for this function. A common choice which we adopt here is called the logistic sigmoid function: $\sigma (z) = \frac{1}{1 + e^{-z}} .$ Its graph is shown in the figure below.

 Logistic graph. code

Given this set-up, the functioning of the perceptron can be phrased in geometrical terms. To do this, consider the hyperplane in ℝn (which is a line for n = 2 and a plane for n = 3) in Cartesian form ${\bf w} \bullet {\bf x} = b ,$ which is determined by the weight vector w and the bias b of the perceptron. If a point x ∈ ℝn is ’above’ this hyperplane, so that z = wxb > 0, then, from the asymptotic behavior of the logistic sigmoid, the output of the perceptron is close to 1. On the other hand, for a point x ∈ ℝn below this hyperplane, so that z = wxb < 0, the perceptron’s output is close to 0. In other words, the purpose of the perceptron is to 'decide’ whether a given input vector x is above or below the hyperplane.

So far this does not seem to hold much interest — all we have done is to re-formulate a sequence of simple mathematical operations related to the Cartesian form of a (hyper)plane in a different language. The point is that the internal state of the perceptron, that is the choice of hyperplane specified by the weight vector w and the bias b, is not inserted ’by hand’ but rather determined by a learning process. This works as follows. Imagine a certain quantity, y, rapidly changes from 0 to 1 across a certain hyperplane in ℝn whose location is not a priori known. Let us perform m measurements of y at locations x(1), … , x(m) ∈ ℝn resulting in measured values y(1), … , y(m) ∈ {0, 1}. These measurements can then be used to train the perceptron. Starting from random values w(1) and b(1) of the weight vector and the bias, we can iteratively improve those values by carrying out the operations ${\bf w}^{(a+1)} = {\bf w}^{(a)} + \lambda \left( y^{(a)} - y \right) {\bf x}^{(a)} , \qquad b^{(a+1)} = b^{(a)} - \lambda \left( y^{(a)} - y \right) . \tag{15.1}$ Here, y is the output value produced by the perceptron given the input vector x(a) and λ is a real value, typically chosen in the interval [0, 1], called the learning rate of the perceptron. Evidently, if the value y produced by the perceptron differs from the true, measured value y(a). the weight vector and the bias of the perceptron are adjusted according to Eqs. (15.1). This training process continues until all measurements are used up and the final values w = w(m+1) and b = b(m+1) have been obtained. In this state the perceptron can then be used to ’predict’ the value of y for new input vectors x. Essentially, the perceptron has ’learned’ about the location of the hyperplane via the training process and is now able to decide whether a given point is located above or below.

In the context of artificial neural networks, the perceptron corresponds to a single neuron. More complicated neural networks can be constructed by combining several perceptrons (and, frequently, other building blocks). The learning process for such larger networks is similar to the one for the perceptron described above and it underlies many applications, for example to pattern recognition.

End of Example 15

1. Find the vector equation of the line in ℝ³ with Cartesian equation $\frac{x-2}{3} = \frac{y +4}{2} = \frac{5-z}{4} .$
2. Convert the line in parametric form given by ${\bf x}(t) = \begin{pmatrix} \phantom{-}2 \\ \phantom{-}1 \\ -1 \end{pmatrix} + t \begin{pmatrix} -2 \\ -1 \\ \phantom{-}3 \end{pmatrix}$ into Cartesian form.
3. Let \begin{align*} &\quad L_1 \quad \mbox{be the line with equation} \quad \begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{pmatrix} 1 \\ 3 \\ 2 \end{pmatrix} + t \begin{pmatrix} -1 \\ \phantom{-}5 \\ \phantom{-}4 \end{pmatrix} , \\ &\quad L_2 \quad \mbox{be the line through}\ (8, 0, -3) \mbox{ parallel to the vector } \begin{pmatrix} \phantom{-}6 \\ \phantom{-}2 \\ -1 \end{pmatrix} , \\ &\quad L_3 \quad \mbox{be the line through}\ (9, 3, 1) \mbox{ and } (7, 13, 9). \end{align*} Show that two of the lines intersect, two are parallel, and two are skew. Find the angle of intersection of the two intersecting lines.
4. Find the minimal distance of the line x(t) = p + tw from the point p₀, where p = (2, −1, 4), w = (3, −5, 2), and p₀ = (1, 1, 1).
5. Show that the line x(t) = p + tw, where p = (2, 3, 1) and w = (−1, 4, 2), does not intersect the plane 2x + z = 3.
6. Find an equation of plane that goes through the point P₀ = (−1, 2, 1) and having normal vector n = (3, 1, −2).
7. Determine a parametric form and Cartesian form of an equation of a plane that goes through three points P = (2,1,−2), Q = (4, 4, 2), and R = (−4, 1 −2).
8. Consider the plane π passing through the point P = (1, 2, 1) with normal vector n = [3, −2, 4]. Determine the line L perpendicular to π and passing through the point Q = (7, −1, 3).
9. Consider two lines Li = {pi + twit ∈ ℝ} ⊂ ℝ², where i = 1, 2, with p₁ = (1, b), w₁ = (3, −2), p₂ = (0, −7), and w₂ = (2, 𝑎) and 𝑎, b ∈ ℝ. Find the intersection L₁ ∩ L₂ for all values of 𝑎, b.
10. Determine the intersection of the two planes: $2x + y − z = 5, \qquad x - 3y + 2z = 6.$
11. For p₁, p₂ ∈ ℝ² or ℝ³ and p₁ ≠ p₂, show that there is precisely one line L with p₁, p₂ ∈ L.
12. Let the π be the plane given by: $\begin{cases} x &= 3 + 2s + t , \\ y &= -2s + 4t , \\ z &= -1+s-2t . \end{cases}$ Determine the line r perpendicular to π and passing through the point P = (−2, 1, 8).
13. Find the Cartesian equation for the plane in ℝ³ that contains p₁ = (1, −2, 3), p₂ = (5, 3, −1), and p₃ = (−4, 1, 2).
14. Find parametric equations for the intersection of the planes 5x + 3y − 2z = 2, 3x − 4y + 5z = 9. Also calculate the angle formed by the two planes, that is, by the two lines normal to the planes.
15. In ℝ³, given the plane π, 3x + 5yz = 0 and the line L: x = 2t−3, y = t+1, z = 2t + 4, calculate (if it exists) the line through (0, 0, 0) and π ∩ L.
16. In ℝ³, consider the equations x₁(t) = p₁ + tw₁ and x₂(t) = p₂ + tw₂, where w₁ and w₂ are linearly independent and t ∈ ℝ. For which value of t is the distance of x₁(t) and x₂(t) minimal and what is this minimal distance?
17. For given two lines $L_1 \, : \ \begin{cases} x + y &= 1 , \\ z-1 &= 0, \end{cases} \qquad L_2 \, : \ \begin{cases} x + y &= 2z +2 , \\ z+1 &= 0, \end{cases}$ show that L₁, L₂ belong to the same plane.
18. In ℝ³, given the plane π: x + y − 2z + 4 = 0 and the line $L \, : \ \begin{cases} x - 2z &= -12, \\ y-4 &= 0. \end{cases}$ Determine the distance between π and L.
19. In ℝ³, given the plane π with Cartesian equation 2x − 3y + z + 4 = 0 and point P = (3, 2, −1). Find a Cartesian equation of the plane passing through P that is parallel to π.

1. Conrad, K., Exterior Powers, 2013.
2. Lang, S., Algebra, 3rd Ed. Springer, New York, 2013/2002.
3. Fitzpatrick, S., Linear Algebra: A second course, featuring proofs and Python. 2023.
4. Lucht, P., Tensor Products, Wedge Products and Differential Forms, Rimrock Digital Technology, Salt Lake City, Utah 84103.
5. Lucht, P., Tensor Analysis and Curvilinear Coordinates (2016.
6. Roman, S., Advanced Linear Algebra, 3rd Ed. (Springer, New York, 2008).
7. Shankar, R., Principles of Quantum Mechanics, 2nd Ed. (Plenum Press, New York, 1994).
8. Suter. J., Geometric Algebra Primer (2003, www.jaapsuter.com/geometric-algebra.pdf ).