Planes and Their Intersections

By:  Debra Woods

In this lesson, given the equations of any three planes in three variables, the program will solve the system, and display graphically the solution.

Initialization

<< "LinearAlgebra`GaussianElimination`"Clear[x, y, z1, z2, z3]; h = 5; spacer = (h/10); threedims = 
      Graphics3D[{{Line[{{-h, 0, 0}, {h, 0, 0}}]}, 
          Text["x", {h + spacer, 0, 0}], {
            Line[{{0, -h, 0}, {0, h, 0}}]}, 
          Text["y", {0, h + spacer, 0}], {
            Line[{{0, 0, -h}, {0, 0, h}}]}, 
          Text["z", {0, 0, h + spacer}]}, Boxed -> False, 
        Axes -> False, ViewPoint -> {1.75, 1.224, 1.7}, 
        AspectRatio -> Automatic];

Let's begin by solving the system
2x -  y +  z = 5
x -  y -  z = 4
-2x + 2y  +  z = -6

m = {{2, -1, 1}, {1, -1, -1}, {-2, 2, 1}}; b = {5, 4, -6}; LinearSolve[m, b]

We see that the solution is a point!

Let's look at the point graphically, as the intersection of the planes.

z1[x_, y_] = 5 + y - 2 x; z2[x_, y_] = -4 - y + x; z3[x_, y_] = -6 - 2 y + 2 x; n = 2; plane[1] = 
      Plot3D[z1[x, y], {x, -n, n + 5}, {y, -n, n + 2}, 
        Boxed -> False, DisplayFunction -> Identity]; plane[2] = 
      Plot3D[z2[x, y], {x, -n, n + 5}, {y, -n, n + 2}, 
        Boxed -> False, DisplayFunction -> Identity]; plane[3] = 
      Plot3D[z3[x, y], {x, -n, n + 5}, {y, -n, n + 2}, 
        Boxed -> False, DisplayFunction -> Identity]; graphs = Table[plane[a], {a, 1, 3}]; Show[
      GraphicsArray[graphs, DisplayFunction -> $DisplayFunction]]; 
    Show[threedims, graphs, 
      PlotRange -> {{-1, 7}, {-1, 5}, {-5, 1}}, 
      DisplayFunction -> $DisplayFunction];

Show[%, ViewPoint -> {2.670, 4.000, 1.780}];

Show[%, ViewPoint -> {-2.981, 4.000, 2.958}];

Let's investigate the solution of the system
x + 2y - 3z = -1
3x -  y + 2z =  7
5x + 3y - 4z =  2

m = {{1, 2, -3}, {3, -1, 2}, {5, 3, -4}}; b = {-1, 7, 2}; LinearSolve[m, b];

From the message, we can see that there is no solution to this system.  Let's see what the planes look like.

z1[x_, y_] = (1/3) + ((2 y)/3) + (x/3); z2[x_, y_] = (7/2) + (y/2) - ((3 x)/2); z3[x_, y_] = -(1/2) + ((3 y)/4) + ((5 x)/4); n = 2; plane[1] = 
      Plot3D[z1[x, y], {x, -n, n + 5}, {y, -n, n}, 
        Boxed -> False, DisplayFunction -> Identity]; plane[2] = 
      Plot3D[z2[x, y], {x, -n, n + 5}, {y, -n, n}, 
        Boxed -> False, DisplayFunction -> Identity]; plane[3] = 
      Plot3D[z3[x, y], {x, -n, n + 5}, {y, -n, n}, 
        Boxed -> False, DisplayFunction -> Identity]; graphs = Table[plane[a], {a, 1, 3}]; Show[
      GraphicsArray[graphs, DisplayFunction -> $DisplayFunction]]; 
    Show[threedims, graphs, 
      PlotRange -> {{-1, 7}, {-1, 5}, {-5, 1}}, 
      DisplayFunction -> $DisplayFunction];

Show[%, ViewPoint -> {-1.200, 3.820, 2.380}, 
      PlotRange -> {{-1, 7}, {-1, 5}, {-3, 3}}];

Let's investigate the solution of the system
x +  y -  z =  1
2x + 3y + 2z =  3
x + 2y + 3z =  2

m = {{1, 1, -1}, {2, 3, 2}, {1, 2, 3}}; b = {1, 3, 2}; LinearSolve[m, b]

Using LinearSolve in this case gives what looks like an answer, but this system in fact has infinite solutions.  Let's investigate further.  The following yields the row-reduced form of the matrix A augmented with B.

MatrixForm[a = {{1, 1, -1}, {2, 3, 2}, {1, 2, 3}}]; b = {1, 3, 2}; c = {b}; aug = Join[Transpose[a], c]; at = Transpose[aug]; naug = MatrixForm[at]; redform = RowReduce[at]; MatrixForm[redform]

z1[x_, y_] = -1 + y + x; z2[x_, y_] = (3/2) - ((3 y)/2) - x; z3[x_, y_] = (2/3) - ((2 y)/3) - (x/3); n = 2; plane[1] = 
      Plot3D[z1[x, y], {x, -n, n + 5}, {y, -n, n}, 
        Boxed -> False, DisplayFunction -> Identity]; plane[2] = 
      Plot3D[z2[x, y], {x, -n, n + 5}, {y, -n, n}, 
        Boxed -> False, DisplayFunction -> Identity]; plane[3] = 
      Plot3D[z3[x, y], {x, -n, n + 5}, {y, -n, n}, 
        Boxed -> False, DisplayFunction -> Identity]; graphs = Table[plane[a], {a, 1, 3}]; Show[
      GraphicsArray[graphs, DisplayFunction -> $DisplayFunction]]; 
    Show[threedims, graphs, 
      PlotRange -> {{-1, 4}, {-1, 3}, {-2, 3}}, 
      DisplayFunction -> $DisplayFunction, 
      ViewPoint -> {-2.760, 3.720, 2.380}];

Show[%, ViewPoint -> {-2.760, 3.720, 0.0}];

It can be seen from the plots that the three planes intersect along a line.