Lines and Planes

Lines

Vector Equation of Line

r(t)=(Subscript[r, 0])+t v

r0={1,2,3}
v={-1,2,3}
r[t_]=r0+t v

ParametricPlot3D[r[t],{t,-20,20},PlotStyle->{Red,Thick}]

Parametric Equation of Line

x=(Subscript[x, 0])+t (Subscript[v, 1])
y=(Subscript[y, 0])+t (Subscript[v, 2])
z=(Subscript[z, 0])+t (Subscript[v, 3])

x=1-t
y=2+2 t
z=3+3 t

ParametricPlot3D[{x,y,z},{t,-20,20},PlotStyle->{Blue,Thick}]

Example

Determine if the following lines are parallel, intersecting, or skew. If the intersect, find the point of intersection.

L1: x=1+2t,y=t,z=1+4t
L2:x=s,y=-2+2s,z=-2+3s

Solution

Look for intersection:

eq1 = 1 + 2t == s
eq2 = t ==  -2+2s
eq3 = 1+4t==-2+3s
Solve[{eq1,eq2,eq3},{t,s}]

Plot lines:

Clear[line1,line2]
line1[t_] = {1+2t,t,1+4t};
line2[s_] = {s,-2+2s,-2+3s};plotline1 = ParametricPlot3D[Evaluate[line1[t]],{t,-20,20},PlotStyle->{Red,Thick}];
plotline2 = ParametricPlot3D[Evaluate[line2[s]],{s,-20,20},PlotStyle->{Blue,Thick}];
Show[plotline1,plotline2]

Planes

Vector Equation of Plane

n.(r-(Subscript[r, 0]))=0

Clear[x,y,z,r]
n={1,7,-2}
r={x,y,z}
r0={3,6,1}

n.(r-r0)==0

ContourPlot3D[n.(r-r0)==0,{x,-20,20},{y,-20,20},{z,-100,50}]

Another way to plot the plane :

Clear[x,y,z,r]
n={1,7,-2}
r={x,y,z}
r0={3,6,1}

n.(r-r0)==0

Solve[%,z]

Plot3D[(1/2) (-43+x+7 y),{x,-20,20},{y,-20,20},PlotStyle->{Red,Thick}]

Parametric Equation of a Plane

r(t)=(Subscript[r, 0])+t (Subscript[v, 1])+s (Subscript[v, 2])

Clear[x,y,z,r]
r0={1,2,1}
v1={1,4,-3}
v2={0,4,0}
r[t_]=r0+t* v1+s*v2

ParametricPlot3D[r[t],{t,-5,5},{s,-5,5},PlotStyle->{Blue,Thick}]

Example from class: Plane through P(3,-1,2), Q(8,2,4), R(-1,-2,-3)

Solution 1

Clear[x,y,z,r]
r0={3,-1,2}
v1={5,3,2}
v2={-4,-1,-5}
r[t_]=r0+t* v1+s*v2

point1=Graphics3D[{Red,Sphere[{3,-1,2},2]}];
point2=Graphics3D[{Red,Sphere[{8,2,4},2]}];
point3=Graphics3D[{Red,Sphere[{-1,-2,-3},2]}];

plane=ParametricPlot3D[r[t],{t,-5,5},{s,-5,5},PlotStyle->{Blue,Thick}];
Show[point1,point2,point3,plane]

Solution 2

Clear[x,y,z,r]
n={-13,17,7}
r={x,y,z}
r0={3,-1,2}

n.(r-r0)==0

plane=ContourPlot3D[n.(r-r0)==0,{x,-20,20},{y,-20,20},{z,-100,50}]
Show[point1,point2,point3,plane]

Example from class: Find plane through A(1,-2,1) and perpendicular to vector from origin to A

Visualization:

Clear[x,y,z,r]
n={1,-2,1}
r={x,y,z}
r0={1,-2,1}

n.(r-r0)==0

point1=Graphics3D[{Red,Sphere[{1,-2,1},0.2]}];
vector1=Graphics3D[{Red,Thick,Line[{{0,0,0},{1,-2,1}}]}];

plane=ContourPlot3D[n.(r-r0)==0,{x,-1,2},{y,-4,1},{z,-5,5}];
Show[point1,vector1,plane]

Example from class: Find plane through A(1,-2,1) and parallel to vector from origin to A

Visualization:

Clear[x,y,z,r]
n={1,1,1}
r={x,y,z}
r0={1,-2,1}

n.(r-r0)==0

point1=Graphics3D[{Red,Sphere[{1,-2,1},0.2]}];
vector1=Graphics3D[{Red,Thick,Line[{{0,0,0},{1,-2,1}}]}];

plane=ContourPlot3D[n.(r-r0)==0,{x,-1,2},{y,-4,1},{z,-5,5}];
Show[point1,vector1,plane]