Linear dependence in 3D.

Ivan Cnop
Vrije universiteit Brussel
icnop@vub.ac.be

Set-up

Start by

<< RealTime3D`

This environment allows rotation by mouse of the whole picture.
Under this environment the 3D plots are smaller than in the   <<Default3D`   environment. 
Enlarging the graphics output cells will help to view the intersections.

Planes in 3D

Plotting a plane

An infinite plane cannot be drawn (faithfully, i.e. using linear functions only) on a computer screen. 
Therefore we only show part of the plane, keeping in mind that it extends in every direction:

span[u_, v_] := 
      ParametricPlot3D[t u  +  s v, {t, -3, 3}, {s, -3, 3}] /; 
        Length[u] == Length[v]

span[{1, 0, 1}, {2, 1, 0}]

Multiplying vector by a constant does not change the plane. Convince yourself:

span[{2, 0, 2}, {-4, -2, 0}]

Show[%, %%]

Planes in general position

Example

span[{1, 1, 0}, {2, 1, 0}]

span[{1, 1, 0}, {1, 1, 2}]

And here is the intersection:

Show[%, %%, %%%]

While intersections of two of these planes are lines, all three planes  intersect only in the origin, in the center of the box. 
This point is the only solution to the  3 x 3  system with these coefficients.

Dependence in planes

Example

span[{2, 0, 2}, {2, 1, 0}]

span[{1, 1, 0}, {4, 2, 0}]

span[{0, 2, -2}, {2, 1, 0}]

Show[%, %%, %%%]

The intersection of these planes is a line.

There are infinitely many solutions to the corresponding system of equations.

The general equation for a plane

Scalar or Dot product.

a =. ; b =. ; c =. ;

Given a vector (a,b,c), find all vectors perpendicular to it

{a, b, c} . {x, y, z}==0

perp = {a, b, c} . {x, y, z} -> 0

If   c   is not   0   we can write   z   as a function of   x   and   y

solveZ = Solve[{a, b, c} . {x, y, z} == 0 , z]

z /. First[solveZ]

a = 1; b = 2; c = -1;
\(		Plot3D[
      z /. First[solveZ\ ], {x, \(-3\), 3}, {y, \(-3\), 3}]\)

If c is zero, we have to solve for one of the other variables.

Several planes

Correspond to the same number of perpendicular vectors.
If three vectors are not in the same plane, the intersection of the perp planes is a point.
If three vectors are in the same plane, the intersection of the perp planes is at least a line.

Exercise

Write out the previous Plot3D[...]  for three choices of vectors {a,b,c} , plot the corresponding planes and show their intersections.

Planes not going through the origin

A plane parallel to the previous one is obtained by adding the vector  (x0,y0,z0) :

Expand[{a, b, c} . ({x, y, z} + {x0, y0, z0}) ] /. perp

Projection perpendicular to a vector

Target plane

a =. ; b =. ; c =. ;

We will often ask that the vector with these coordinates has length equal to   1 :

length1 = {a, b, c} . {a, b, c} -> 1

({x, y, z} . {a, b, c}) {a, b, c}

This is a multiple of the vector {a,b,c}. If we make the difference between  {x,y,z} and this one , this difference is perpendicular to the vector {a,b,c}:

Expand[({x, y, z} - ({x, y, z} . {a, b, c}) {a, b, c}) . {a, b, 
            c}] // Simplify

% /. length1

Write projection of  {x,y,z}  on  {a,b,c}

proj[{x_, y_, z_}, {a_, b_, 
          c_}] := ({x, y, z} . {a, b, c})/({a, b, c} . {a, b, 
                c}) {a, b, c}

image1 = proj[{1, 0, 0}, {a, b, c}]

image2 = proj[{0, 1, 0}, {a, b, c}]

image3 = proj[{0, 0, 1}, {a, b, c}]

Make columns from these lists

A = Transpose[{image1, image2, image3}];

A // MatrixForm

A . {x, y, z}

The projection of all vectors from the plane itself gives   0  after simplification :

A . {x, y, -(a x + b y)/c}

% // Simplify

Adding perspective and 3D rendering

Perspective can be added reducing the vector in the target plane with a coefficient  
(1+k x  distance from plane)  for points before it, 
(1-k x  distance from plane)  for points behind it. 
    [here  k  is some small constant]

Such routines are fully implemented in all softwares for rendering 3D  graphics on a computer screen. 
Other Graphics environments allow even more sophisticated rendering: stereoscopic views, zooming, ....
Examples of such environments are Live3D and OpenGL. They are used in the MathWorld encyclopeadia.

Reset

<< Default3D`