Demonstrating the intersection of three planes in space

This notebook accepts, in implicit form, the equation of 3 planes in 3-space. The equations of the planes to be used should be entered after the " :=" signs in the first  two lines of the input cell immediately below. Note that when the equations are entered a double equals sign "==" should be used. (See "equal" in the help index if you wish to know why.) The equations of the planes need to contain a z-term for the implementation to be effective, as each equation is solved for z so that it can be plotted using Mathematica's standard 3D plotting function.



Evaluating the  input cell plots each plane separately, then the three planes together, in the 20 by 20 by 20 cube with the origin at its centre. The  solution of the 3 by 3 system, if it exists, is found and plotted . If there is no unique solution for the system you will receive a  message about the sought solution not being a proper list of 3 numbers.



If you have three planes enter their  equations  and evaluate (Shift-Enter), or use he three equations supplied, and view their solution.

eq1[x_,y_,z_]:= x+2y+ z==-1

eq2[x_,y_,z_]:= 2x +y-z==3

eq3[x_,y_,z_]:=  x-2y+ z== 1

f1[x_,y_]:=Replace[z,Flatten[Solve[eq1[x,y,z],z]]]

f2[x_,y_]:=Replace[z,Flatten[Solve[eq2[x,y,z],z]]]

f3[x_,y_]:=Replace[z,Flatten[Solve[eq3[x,y,z],z]]]

p1:=Plot3D[{f1[x,y],Hue[.6,.3,1]},{x,-10,10},{y,-10,10},AxesLabel->{x,y,z},ClipFill->None,

	PlotRange->{-10,10},BoxRatios->{1,1,1},

	PlotLabel->eq1[x,y,z],

	ViewPoint->{1.703,2.923,-0.078}]

p2:=Plot3D[{f2[x,y],Hue[.85,.4,1]},{x,-10,10},{y,-10,10},AxesLabel->{x,y,z},ClipFill->None,

	PlotRange->{-10,10},BoxRatios->{1,1,1},

	PlotLabel->eq2[x,y,z],

ViewPoint->{1.703,2.923,-0.078}]

p3:=Plot3D[{f3[x,y],Hue[.1,.3,1]},{x,-10,10},{y,-10,10},AxesLabel->{x,y,z},ClipFill->None,

	PlotRange->{-10,10},BoxRatios->{1,1,1},

	PlotLabel->eq3[x,y,z],

	ViewPoint->{1.703,2.923,-0.078}]

pt:=ReplaceAll[{x,y,z},Flatten[Solve[{eq3[x,y,z],eq1[x,y,z],eq2[x,y,z]},

					{x,y,z}]]]

p4:=Graphics3D[{Hue[0.0],PointSize[0.01],Point[pt]}]

p21:=Show[{p1,p2,p3,p4},	PlotLabel->{"The 3 planes"}]

p21