Week 3   Projective Geometry
Homogeneous coordinates

© Dana Scott 1993/1997/1998

Notebook  last edited: 11 September 1998

Homogeneous Coordinates for Points and Lines

Projecting points and lines

An example of a projection between planes

In 3D space let us consider the two planes z==0 (i.e., the x,y-plane) and x==0 (i.e., the y,z-plane).  These two (coordinate) planes are orthogonal to each other, and they pass through the origin {0,0,0}.

Using the point P=={1,1,1} (which does not lie on either of the two planes) as the center of a projection, we wish to find the formula for the transformation that maps the "ground" plane z==0 to the "canvas" plane x==0.

In cross-section along the x- and z-axes, the projection looks like this:

The basic question is how to find the coordinates of the point on the vertical plane that corresponds to the the point {x,y,0} on the horizontal plane.

We can solve this by vector algebra, because all points on the vertical plane (point = end of vector) are orthogonal to the unit vector {1,0,0}.  Thus, we just have to invoke the parametric representation of points on the line between {1,1,1}and {x,y,0} and solve for the value of the parameter that puts the point on the vertical plane.

Here it is:

\(ClearAll[x, y, z, t]; 

    sol = Solve[{1, 0, 0} . 
            \(({1, 1, 1} + t\ \(({x, y, 0} - {1, 1, 1})\))\) == 0, {t}]\)

Next, we substitute the solution back into the representation and do some algebraic simplification to get a nice looking answer:

Together[{1, 1, 1} + t ({x, y, 0} - {1, 1, 1}) /. 
        sol[[1]]]

We have gone from points on one plane to points on another plane, because we were using the 3D construction of the projection with the aid of projecting lines in space.  But, once we find an algebraic formula, we can use this to give "the same" transformation from a plane into itself.

Here is the definition of the related transformation as a function on points of the form {x, y, 1}, which consists of points on the plane z == 1.

F[{x_, y_, 1}] := {((y - x)/(1 - x)), -(x/(1 - x)), 1};

Now, suppose we have three points {(Subscript[a, 1]), (Subscript[a, 2]), 1}, {(Subscript[b, 1]), (Subscript[b, 2]), 1}, and {(Subscript[c, 1]), (Subscript[c, 2]), 1}.  We want to know when the image points are collinear.  So we map the points and use The Determinant Check (to be explained later):

Together[Det[F/@{{(Subscript[a, 1]), (Subscript[a, 2]), 1}, {(Subscript[b, 1]), (Subscript[b, 2]), 1}, {(Subscript[c, 1]), (Subscript[c, 2]), 1}}]]

When we compare this with the determinant of the original three points, we see that the numerator above is just the negative of the determinant.

Det[{{(Subscript[a, 1]), (Subscript[a, 2]), 1}, {(Subscript[b, 1]), (Subscript[b, 2]), 1}, {(Subscript[c, 1]), (Subscript[c, 2]), 1}}]

Thus, we have "proved" that under projection (at least in this one instance), three points are collinear if, and only if, the image points are.

A problem with central projections

The central projection we just discussed had as its center the point {1,1,1}.  The only reason for making use of this point was that it was easy — for a time — to work with the coordinate planes in ordinary xyz-space in order to find a simple formula for an example of a projective transformation between planes.

A more symmetric choice of a center is to move the centeral point to the origin {0,0,0}, since the exact choice of the coordinates of the point clearly makes no difference conceptually.

Now, in a central projection under this convention, the projecting rays are all the lines through the origin.  Given a ray, it intersects each plane (not passing through the origin) in a point—unless, of course, the ray is parallel to the plane.  This problem of parallelism is just the rub, however:

The Puzzle. Unless the two planes between which we wish to set up a projective correspondence are parallel, the rays do not set up a one-one correspondence between the points of one plane and the points of the other plane.

This problem can be seen in the following two diagrams (showing, actually, central projections between lines).  The first case shows there is a ono-one correspondence; the second case shows that there are exceptional points on each of the two planes.

We will need an algebraic way to represent the "missing" points.

Diagram implementations (optional)

For reference, here is how the pictures above were drawn using Mathematica graphics commands.

Module[{AA, BB, CC, 
        PP}, {AA, BB, CC, PP} = {{-5, 0}, {-2, 0}, {0.5, 0}, {1, 1}}; 
      Show[Graphics[{AbsoluteThickness[2], Line[{{0, -10}, {0, 10}}], 
            Line[{{-10, 0}, {10, 0}}]}], 
        Graphics[{AbsolutePointSize[8], Point[AA], 
            Text["A", AA + { .55, - .30}]}], 
        Graphics[{AbsolutePointSize[8], Point[BB], 
            Text["B", BB + { .55, - .30}]}], 
        Graphics[{AbsolutePointSize[8], Point[CC], 
            Text["C", CC + { .55, - .30}]}], 
        Graphics[{AbsolutePointSize[8], Point[PP], 
            Text["P", PP + {- .55,  .25}]}], 
        Graphics[{AbsoluteThickness[2], RGBColor[1, 0, 0], 
            Line[{2 PP - AA, 5 AA - 4 PP}], 
            Line[{2 PP - BB, 5 BB - 4 PP}], 
            Line[{2 PP - CC, 5 CC - 4 PP}]}], Axes -> None, 
        AspectRatio -> (9/17), 
        PlotRange -> {{-10, 7}, {-5, 4}}]];

Block[{AA, BB, CC, DD, EE, 
        FF}, {AA, BB, CC, DD, EE, 
          FF} = {{5, 0}, {5, 1}, {5, 2}, {5, 5}, {1, 5}, {-4, 5}}; 
      Show[Graphics[{AbsoluteThickness[2], Line[{BB, BB - 2 AA}], 
            Line[{CC, CC - 2 AA}]}], 
        Graphics[{AbsoluteThickness[2], RGBColor[1, 0, 0], 
            Line[{AA, -AA}], Line[{DD, -DD}], Line[{EE, -EE}], 
            Line[{FF, -FF}]}], 
        Graphics[{AbsolutePointSize[8], Point[AA - AA]}], Axes -> None, 
        AspectRatio -> 1, 
        PlotRange -> {{-5, 5}, {-5, 5}}]];

\(\(Block[{AA, BB, CC, DD, EE, FF}, \ 
      
{AA, BB, CC, DD, EE, FF, GG, HH}\  = \ 

        \ \ \ \ \ \ \ {{5, 0}, {5, 1}, {5, 2}, {5, 5}, {1, 5}, {\(-4\), 5}, {
            \(-1\), 5}, {0, 5}}; 

      Show[Graphics[{AbsoluteThickness[2], 
	\ 	
            Line[{BB, \ BB\  - \ 2\ AA}], 
	\ 	Line[{\(-EE\), \ GG}]}], 

        	\ Graphics[{AbsoluteThickness[2], \ RGBColor[1, 0, 0], 
	\ 	
            Line[{AA, \ \(-AA\)}], \ Line[{DD, \ \(-DD\)}], 
            Line[{HH, \ \(-HH\)}], 
	\ 	Line[{EE, \ \(-EE\)}], \ 
            Line[{FF, \ \(-FF\)}]}], 
	\ 
        Graphics[{AbsolutePointSize[8], \ Point[AA - AA]}], 
	\ 
        Axes\  -> \ None, \ AspectRatio\  -> \ 1, \ 
	\ 
        PlotRange\  -> \ {{\(-5\), 5}, {\(-5\), 5}}]]; \)\)

Perspective drawing

Drawing cubes

What is a cube?  It is a geometric figure, which, in 3 dimensions, has 8 vertices, 12 edges, and 6 faces.  But, in order to draw a picture of a cube, we first have to find a convenient listing of the vertices — as 3D-coordinates.  We will take it to be a unit cube (i.e., all edges have a unit length), and we will place it with one face on the x,y-plane and the back face one unit away from the x,y-plane.  Then, we have to list the faces, and finally we fill in the edges using Mathematica graphics primitives for representing lines.  Here is our version of the required data structure.

\(ClearAll[pp, qq, rr, ss, tt, uu, LL, ll, mm, nn]; 


    cube = Module[{pp, qq, rr, ss, tt, uu, LL, ll, mm, nn}, 
        pp = {{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}; 
        qq = {{0, 0, 1}, {0, 1, 1}, {1, 1, 1}, {1, 0, 1}}; 
        rr = {pp[[1]], 
            pp[[4]], 
            qq[[4]], 
            qq[[1]]}; 
        ss = {pp[[2]], 
            pp[[3]], 
            qq[[3]], 
            qq[[2]]}; 
        tt = {pp[[1]], 
            pp[[2]], 
            qq[[2]], 
            qq[[1]]}; 
        uu = {pp[[4]], 
            pp[[3]], 
            qq[[3]], 
            qq[[4]]}; 
        LL[p_, q_] := Line[{p, q}]; ll = MapThread[LL, {pp, qq}]; 
        mm = MapThread[LL, {rr, ss}]; nn = MapThread[LL, {tt, uu}]; 
		
        Join[ll, mm, nn]]; \)

Let us check the output.

cube

Now, Mathematica has built in a command for displaying such 3D line drawings.

cp = Show[Graphics3D[cube], Boxed -> False];

That looks quite nice.  Of course, our computer screen is only 2D, so this is a projection giving us a perspective drawing of the cube.  And, if we like we can view it from other viewpoints, say, from below.

Show[cp, ViewPoint -> {2.527,  -1.708,  -4.5}];

The convention, here is to think of the z-coordinates as running vertical; so, if we decrease then we get a sort of illusion of moving down.

\(Do[\(Show[%, ViewPoint -> {2.527, \ \(-1.708\), \ \(-z\)}];\), 

      	{z, 2, 10}]\)

That is not a very good illusion, however; because Mathematica — bless its heart — changes scale in each frame so you can see as much of the cube as possible, in the sense that the picture has to fill the frame.  (Sometimes software can be too intelligent!)

Doing our own perspective

In order to understand coordinates better, we will program our movements and projections, and look to see whether the perspective is convincing.

The first thing we do is a routine for a change of scale and a movement by a vector translation.

shift[a_, b_, c_, m_] := 
       {{x_, y_, z_} :>  {a, b, c} + m {x, y, z}}

For example:

(cube /. shift[1, 2, 3, 4]) // TableForm

The reader can check it out:  now the lengths of all the lines is 4.

Next, we think of the plane z==1 as the plane of the picture.  We think of the origin as the center of the projection (place of the "eye").  And then we have to reduce x,y,z-coordinates to x,y-coordinates.  Since the z-coordinate has to be reduced to 1, all we have to do is divide by that coordinate value.

project  :=  {{x_, y_, z_} :> {x/z, y/z}}

Here is the result:

\(ff = \((cube /. shift[1, 2, 3, 4])\) /. project; 
ff // TableForm\)

By the way, to project a line, we only have to project the end points of the segment we want to show.  (Why?)  Look at the resulting drawing.

\(end = Max[Abs[Join[ff] /. Line -> Identity]] + 0.5; 
    frame = Line[
        end\ {{\(-1\), \(-1\)}, {\(-1\), 1}, {1, 1}, {1, \(-1\)}, {\(-1\), 
              \(-1\)}}]; origin = {PointSize[0.015], Point[{0, 0}]}; 


    Show[Graphics[{origin, frame, ff}], 
	
      PlotRange 
        -> {{\(-end\) - 0.1, end + 0.1}, {\(-end\) - 0.1, end + 0.1}}, 
      AspectRatio -> Automatic]; \)

The center (origin) of the picture plane is shown as a big dot.  Think of y-coordinates now as being vertical, and x-coordinates as horizontal.  Think of the z-coordinates as running behind the picture plane (from z==1 to ∞).   So this particular cube is 2 units behind the picture plane, and it one unit to the right and 2 units above the origin.

Now, we move the cube farther back (say, 9 units behind the picture plane).

\(ff = \((cube /. shift[1, 1, 10, 1])\) /. project; 


    end\  = \ Max[Abs[Join[ff] /. Line -> Identity]] + 0.5; 

    frame\  = \ 
      Line[end {{\(-1\), \(-1\)}, {\(-1\), 1}, {1, 1}, {1, \(-1\)}, {\(-1\), 
              \(-1\)}}]; 
origin\  = \ {PointSize[0.015], Point[{0, 0}]}; 

    
Show[Graphics[{origin, \ frame, ff}], \ \ 
	
      PlotRange\  -> 
        \ {{\(-end\) - 0.1, end + 0.1}, {\(-end\) - 0.1, end + 0.1}}, 
	
      AspectRatio -> Automatic]; \)

Sometimes it is hard to interpret the pictures.  So here is a way of painting reference points on the picture plane at some of the points with integer coordinates.

\(ff = \(cube /. shift[1, 2, 1, 3]\) /. project; 


    refs = {PointSize[0.015], 
        Point/@Flatten[Table[{x, y}, {x, \(-3\), 3}, {y, \(-3\), 3}], 1]}; 
    end = Max[
          Abs[Join[ff, refs] /. {Line -> Identity, 
                Point -> Identity, PointSize -> \((0&)\)}]] + 0.5; 
    frame = Line[
        end\ {{\(-1\), \(-1\)}, {\(-1\), 1}, {1, 1}, {1, \(-1\)}, {\(-1\), 
              \(-1\)}}]; 


    Show[Graphics[{refs, frame, ff}], 
	
      PlotRange 
        -> {{\(-end\) - 0.1, end + 0.1}, {\(-end\) - 0.1, end + 0.1}}, 
      AspectRatio -> Automatic]; \)

That does not look natural, because the cube has one face right on the picture plane.  So, move it back.

\(ff = \(cube /. shift[1, 2, 3, 3]\) /. project; 


    refs = {PointSize[0.015], 
        Point/@Flatten[Table[{x, y}, {x, \(-3\), 3}, {y, \(-3\), 3}], 1]}; 
    end = Max[
          Abs[Join[ff, refs] /. {Line -> Identity, 
                Point -> Identity, PointSize -> \((0&)\)}]] + 0.5; 
    frame = Line[
        end\ {{\(-1\), \(-1\)}, {\(-1\), 1}, {1, 1}, {1, \(-1\)}, {\(-1\), 
              \(-1\)}}]; 


    Show[Graphics[{refs, frame, ff}], 
	
      PlotRange 
        -> {{\(-end\) - 0.1, end + 0.1}, {\(-end\) - 0.1, end + 0.1}}, 
      AspectRatio -> Automatic]; \)

That's better.  Now we try a picture with several cubes.

\(cc1 = \(cube /. shift[\ \ \ 4, \(-2\), 6, 3]\) /. project; 
    cc2 = \(cube /. shift[\(-4\), \(-4\), 4, 3]\) /. project; 
    cc3 = \(cube /. shift[\ \ 2, \ \ 3, \ 4, 3]\) /. project; 


    end = Max[Abs[Join[cc1, cc2, cc3] /. Line -> Identity]] + 0.5; 
    frame = Line[
        end\ {{\(-1\), \(-1\)}, {\(-1\), 1}, {1, 1}, {1, \(-1\)}, {\(-1\), 
              \(-1\)}}]; origin = {PointSize[0.015], Point[{0, 0}]}; 


    Show[Graphics[{origin, frame, cc1, cc2, cc3}], 
	
      PlotRange 
        -> {{\(-end\) - 0.1, end + 0.1}, {\(-end\) - 0.1, end + 0.1}}, 
      AspectRatio -> Automatic]; \)

Drawing other figures (optional)

For the sake of comparison, let us try out the regrular octahedron.  First, the data structure.

\(\(octahedron\  = \ 
      Module[{pp, qq, rr, ss, LL, ll, mm, nn}, 

        pp\  = {{0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}}; 

        qq\  = RotateLeft[pp]; 

        rr\  = \ Table[{1/2, \ \ Sqrt[2]/2, 1/2}, {4}]; 

        ss\  = \ Table[{1/2, \(-Sqrt[2]\)/2, 1/2}, {4}]; 

        LL[p_, q_]\  := \ Line[{p, q}]; 
ll\  = \ MapThread[LL, {pp, qq}]; 

        mm\  = \ MapThread[LL, {pp, rr}]; 
nn\  = \ MapThread[LL, {pp, ss}]; 
        
Join[ll, mm, nn]]; \)\)

octahedron // TableForm

Then, two standard Mathematica renderings.

Show[Graphics3D[octahedron], Boxed -> False];

Show[%, ViewPoint -> {3,  -2,  1.5}];

Now, we do our own perspective.

\(oct\ \  = \ \((octahedron /. shift[\ \ 1, \(-2\), 3, 2])\) /. project; 
    

end\  = \ Max[Abs[Join[oct] /. Line -> Identity]] + 0.5; 

    frame\  = \ 
      Line[end {{\(-1\), \(-1\)}, {\(-1\), 1}, {1, 1}, {1, \(-1\)}, {\(-1\), 
              \(-1\)}}]; 
origin\  = \ {PointSize[0.015], Point[{0, 0}]}; 

    
Show[Graphics[{origin, \ frame, oct}], \ \ 
      PlotRange\  -> 
        \ {{\(-end\) - 0.1, end + 0.1}, {\(-end\) - 0.1, end + 0.1}}, 
	
      AspectRatio -> Automatic]; \)

And we can draw two together.

\(oct1\ \  = \ \((octahedron /. shift[\ \ 1, 2, 4, 3])\) /. project; 

    oct2\ \  = \ 
      \((octahedron /. shift[\ \ \(-5\), \(-3\), 4, 4])\) /. project; 


    end\  = \ Max[Abs[Join[oct1, oct2] /. Line -> Identity]] + 0.5; 

    frame\  = \ 
      Line[end {{\(-1\), \(-1\)}, {\(-1\), 1}, {1, 1}, {1, \(-1\)}, {\(-1\), 
              \(-1\)}}]; 
origin\  = \ {PointSize[0.02], Point[{0, 0}]}; 


    Show[Graphics[{origin, \ frame, oct1, oct2}], \ \ 
      PlotRange\  -> 
        \ {{\(-end\) - 0.1, end + 0.1}, {\(-end\) - 0.1, end + 0.1}}, 
	
      AspectRatio -> Automatic]; \)

Introducing coordinates

Projective representations of points and lines

Insight. The somewhat surprising solution to the puzzle of central projections about missing points is simply:
	  	throw away the planes entirely, 
but keep the rays through the fixed center as modelling "potential" points.

That is, for a given ray, if  a plane is chosen, then a point is determined at the intersection of the ray with the plane—unless, of course, the ray is parallel to the plane.  However, for another, non-parallel choice of a plane, that ray will in fact determine a point.  By concentrating on the rays, which form a very "homogeneous" whole, the exceptions engendered by parallelsim are completely avoided.  Here, then, is the definition we will be using.

Definition.  A projective point in the projective 2D-plane is represented by a ray through the origin in (complex) 3-D cartesian space.

The next step is to consider how projective lines should be represented.  Remember that two non-parallel planes always intersect in a line.  Conversely, given a line on a plane not passing through the origin, a unique plane is determined passing through the origin intersecting the given plane in the given line.  This motivates the next definition.

Definition.   A projective line is represented by a plane through the origin.  The rays through the origin lying in the plane make up (the representations) of the projective points lying on (or incident to) the projective line.

If we like, we can say that the rays through the origin parallel to a given plane, represent the points at infinity for that plane (allowing us to imagine that parallel lines do intersect "way out there").  But, remember that a plane in a different position has different points at infinity (cf., the behavior of the projection between two intersecting planes).  However, the represention of projective points by rays through the origin treats all points the same and shows that the points at infinity are just like all the other points.

Review: 
	>> The lines through the origin represent the projective points. 
	>> The planes through the origin represent the projective lines.

Comment: The difference between an ordinary Euclidean plane and the projective plane is that the projective plane has an extra range of points all at infinity which forms a line at infinity.

It should be emphasized again that the representation via rays shows that a line at infinity is no different from any other projective line.  Indeed the line at infinity is the locus of vanishing points of parallel lines on the perspective drawing of a horizontal plane — and on the picture plan they are like other points.  In the projective geometry with the above definitions, a symmetric, uniform treatment thus becomes possible that simplifies both concepts and calculations.

Using vector-space concepts

The foregoing discussion was geometric, we now have to translate the ideas into coordinates using vector algebra.  The translation is quite easy to do — with one twist.

Insight. In terms of vectors, a ray through the origin is determined by any non-zero vector {x,y,z}.  
Caution. This representation is not unique, however, since any non-zero scalar multiple {a x,a y,a z} represents the same ray.

Insight. In terms of vectors, a plane through the origin is determined as all vectors perpendicular  to a given vector {u,v,w}.  
Caution. This representation is also not unique, since any non-zero scalar multiple {a u,a v,a w} represents the same perpendicular plane.

The twist is to use a single vector to determine a whole perpendicular plane.  Let us recall that in terms of vector operations, perpendicularity can be defined by the vanishing of the dot product:

{u,v,w}.{x,y,z} == 0

What we then see here is a linear equation.  If we take {u, v, w} as fixed, then we have a linear form in the variables x,y, and z; we can then call {u, v, w} the coordinates of the linear form.

If we take {x, y, z} fixed, then we have a linear form in the dual set of variables u, v, and w;  we can call {x, y, z} the coordinates of the dual form.  We then revise our definitions, because the use of variables (in a dual set-up) allows us to have a smooth running use of algebra.

Definition.  Projective points and lines are to be identified with these dual linear forms (which form vector spaces).

We emphasize again that the relationship of duality is a perfectly symmetric relationship between projective points and lines.  Both kinds of objects have the same kind of coordinates. Indeed, we will find that theorems—when properly formulated—remain valid when the concepts of point and line are interchanged in the statement of the theorem.  This idea of duality will also be extended from lines to algebraic curves, and it is one of the particurlar advantages of passing from ordinary geometry to projective geometry.

A summary

The fundamental bilinear form is:  u x + v y + w z .

The incidence equation is:  u x + v y + w z == 0.
Another form of the equation is:    {x, y, z} . {u, v, w} == 0.

With uvw fixed the equation represents a line.
A line is the range of all points incident to it.
The numbers uvw are then  line coordinates.

With xyz fixed the equation represents a point.
A point is the pencil of all lines incident to it.
The numbers xyz are then  point coordinates.

Duality comes from the symmetry between points and lines exhibited in the symmetric nature of the fundamental bilinear form.

Bilinear Pairing and Exterior Product

Linear forms and the dual pairing PD

Using PD

We illustrate the algebraic conventions we are going to use throughout.  A linear form — which represents a line — is a linear combination of xyz (including scalars), for example:

l = 3 x + ((a^2) + (b^2)) y + a z

A dual linear form — which represents a point — is a linear combination of uvw, for example:

p = 3 a u + 15 b v + (a - 6 c) w

As we remarked in the previous discussion, the non-zero xyz-forms represent lines (up to a scalar multiple); while the non-zero uvw-forms represent points (up to a scalar multiple).  But, forms are algebraic quantities, not vectors.  Thus we need another operation to pair the forms.

The bilinear pairing, called PD, operates as follows:

PD[l, p]

Assuming that a, b, and c are scalars, then PD[l,p] is also a scalar.

Interpretation.  The equation PD[l, p] == 0 means that:
		the point p lies on the line l. 
(Or dually, that the line l  passes through the point p.)

Comment.  The operation PD giving the dual pairing is defined in the notebook Implementations and has many other uses.  For the time being, however, we can think of it as having this general effect:

PD[(Subscript[a, 1]) x + (Subscript[a, 2]) y + (Subscript[a, 3]) z, (Subscript[b, 1]) u + (Subscript[b, 2]) v + (Subscript[b, 3]) w]

We note — as expected — that PD is for forms what dot product is for vectors.

Dual vector spaces (optional)

In terms of abstract vector spaces, here is a general overview for readers with some background in Linear Algebra of the facts about duality, which we made need for future reference.  All vector spaces to be considered will be finite dimensional.

>>  If  V is a vector space, then the dual space, V*, is the space of all linear mappings (functionals) into the the field of scalars (= the complex numbers here).

>>  The dual pairing between V* and V is the evaluation of the mapping (functional) at the vector.

>>  The dual pairing is bilinear.

>>  In terms of coordinates, linear mappings can always be represented uniquely in terms of dot products {(Subscript[u, 0]), (Subscript[u, 1]), (Subscript[u, 2]), (Subscript[u, 3]),  ... } . {(Subscript[x, 0]), (Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 3]),  ... }.

>>  Dot product, therefore, is the dual pairing in terms of dual coordinate systems.

>>  If W and V are any two finite dimensional vector spaces with a non-trivial bilinear pairing, then each is isomorphic to the dual space of  the other.

>>  The double dual space V** is isomorphic to V (in a very natural way).

Scalars and forms in Mathematica

Warning.  Mathematica  does not make very many distinctions between types.  This is both an advantage and a disadvantage.

In working with linear forms, and later with polynomials, in symbolic computations for theorems of projective geometry it is necessary to distinguish between the "variable" (or "generators") of the polynomial ring and the symbolic "scalars" being (often) used a coefficients (to indicate families of polynomial forms).

To this end, the file Implementations.nb has set aside the six symbols in the list {x,y,z,u,v,w} to be used as variables.  Others are treated as scalars.   Because we are only working in this course on the the projective plane, we need only six special identifiers set aside as variables.  A study of higher-dimensional geometry would require more variables.

In doing many interactive computations, however, one has to be careful that symbols may have been assigned values sometime in the past during a computation session.  From time to time, therefore, it may be wise to invole the command ClearAll applied to symbols to be used as general algebraic quantities.

The actual method in Mathematica  of making the distinctions betwee scalars and forms is to define a degree function, DegP, for all polynomials generated by these variables.  For example we have these results:

list = {5, a, a + b, (a^2), x, u, a2 x + c1 z, a x y + b y z}; 
    TableForm[{{list, DegP/@list}}]

The first four are taken as scalars, the next three are linear forms, and the last is a quadratic form.  Here is an example of a higher degree form:

DegP[
      (((a x + b y + c z))^6) 
        ((((Subscript[d, 1]) (x^2) + (Subscript[d, 3]) x z + (Subscript[d, 5]) (z^2)))^3)]

That is correct, because 12 == 1*6*2*3.

Important Comment.  The advantage of this approach using DegP is that further variables can be declared temporarily to be of a higher degree.

This means that we can from time to time work with variables ranging over polynomials without having to give any notation to a particular form of a polynomial.  For example we can compute degrees as follows, where the first line is a declaration for the new variable:

f /: DegP[f] = 2; list = {f, a f, a (f^2), x y f, a (f^3) - b (x^2) (y^2) (z^2)}; 
    TableForm[{{list, DegP/@list}}]

If we clear f, we get it back to being a scalar:

\(ClearAll[f]; 

    list = {f, a\ f, a\ f\^2, x\ y\ f, a\ f\^3 - b\ x\^2\ y\^2\ z\^2}; 

    TableForm[{{list, DegP/@list}}]\)

Using determinants

The meaning of the determinant.

Question.  What is the geometric meaning of the 2 x 2 determinant |({{(Subscript[a, 1]), (Subscript[a, 2])}, {(Subscript[b, 1]), (Subscript[b, 2])}})| ?

Of course, Mathematica  can calculate determinants in symbolic form.

\(Det[{{a\_1, a\_2}, {b\_1, b\_2}}]
\)Det[{{(Subscript[a, 1]), (Subscript[a, 2]), (Subscript[a, 3])}, {(Subscript[b, 1]), (Subscript[b, 2]), (Subscript[b, 3])}, {(Subscript[c, 1]), (Subscript[c, 2]), (Subscript[c, 3])}}]

That is the algebraic meaning.  However, consider the following diagram.

\(\(Show[Graphics[Line[{{7, 0}, {7, 8}, {0, 8}}]], 
      Graphics[Line[{{5, 0}, {5, 1}, {7, 1}}]], 
	
      Graphics[Line[{{0, 7}, {2, 7}, {2, 8}}]], 
	
      Graphics[{AbsoluteThickness[2], 
          Line[{{0, 0}, {5, 1}, {5, 1} + {2, 7}, {2, 7}, {0, 0}}]}], 
      Graphics[{AbsolutePointSize[6], Point[{2, 7}]}], 
      Graphics[Text[{b\_1, b\_2}, {2 -  .7, 7 +  .25}]], 
      Graphics[{AbsolutePointSize[6], Point[{5, 1}]}], 
      Graphics[Text[{a\_1, a\_2}, {5 +  .7, 1 -  .25}]], 
	
      Axes -> Automatic, 
	AspectRatio -> Automatic]; \)\)

To understand the connection with the determinant, the right-hand expression in the next equation calculates the area of the parallelogram by subtracting from the area of the large rectangle the four triangles and the two little rectangles.

Det[{{(Subscript[a, 1]), (Subscript[a, 2])}, {(Subscript[b, 1]), (Subscript[b, 2])}}] == 
      Expand[((Subscript[a, 1]) + (Subscript[b, 1])) ((Subscript[a, 2]) + (Subscript[b, 2])) - 2 (Subscript[b, 1]) (Subscript[a, 2]) - 
          (Subscript[a, 1]) (Subscript[a, 2]) - (Subscript[b, 1]) (Subscript[b, 2])]

Conclusion. The determinant  |({{(Subscript[a, 1]), (Subscript[a, 2])}, {(Subscript[b, 1]), (Subscript[b, 2])}})| represents the (signed) area of the parallelogram formed by the two vectors {(Subscript[a, 1]), (Subscript[a, 2])} and {(Subscript[b, 1]), (Subscript[b, 2])}.

This interpretation generalizes to 3 and higher dimensions, and to parallelograms in any orientation using higher-dimensional determinants.

Claim. The geometric meaning of the 3x3 determinant |({{(Subscript[a, 1]), (Subscript[a, 2]), (Subscript[a, 3])}, {(Subscript[b, 1]), (Subscript[b, 2]), (Subscript[b, 3])}, {(Subscript[c, 1]), (Subscript[c, 2]), (Subscript[c, 3])}})|as the  (signed) volume in 3-space of the parallelepiped determined by the rows interpreted as vectors.

Here is an example of a 3x3 determinant and a corresponding parallelepiped.

OO = {0,0,0};
AA = {2,2,10};
BB = {5,9,1};
CC = {3,7,2};

edges = {{OO, AA},{OO, BB},{OO, CC},
         {AA, AA+BB},{AA, AA+CC},
         {BB, AA+BB},{BB, BB+CC},
         {CC, AA+CC},{CC, BB+CC},
         {AA+BB, AA+BB+CC},
         {AA+CC, AA+BB+CC},
         {BB+CC, AA+BB+CC}};
         
Det[{AA,BB,CC}]

r = Min[edges]; s = Max[edges]; \(\(Show[Graphics3D[{Thickness[0.009], \ Line/@edges}], 
	
      BoxRatios -> {1, 1, 1}, 
	Axes -> Automatic, 
      PlotRange -> {{r, s}, {r, s}, {r, s}}]; \)\)

So the volume of that box we see is 88 cubic units.  This may not be an obvious fact (and it may not be obvious that vectors with integer components always give integer volumes), but at least it should be clear that the determinant is 0 exactly when the three vectors are coplanar.   Why?  Because we know from the theory of matrices that the determinant of a square matrix vanishes exactly when the matrix is singular (i.e., has no inverse).  A singular matrix has non-independent rows (Why?).  In the case of 3x3 matrices, this means that one row is a linear combination of the other two.  But this is the same as saying the three vectors are coplanar.

These facts, for example, can be used to discover many useful formulas.  Here is a classic instance, which can also be generalized to higher dimensions.  More examples are given in the following subsections.

Claim.  In the Cartesian plane, the point {x, y} lies on the line joining distinct points {(Subscript[a, 1]), (Subscript[a, 2])} and {(Subscript[b, 1]), (Subscript[b, 2])}  exactly when the following determinant vanishes.  (Why?)

Det[{{(Subscript[a, 1]), (Subscript[a, 2]), 1}, {(Subscript[b, 1]), (Subscript[b, 2]), 1}, {x, y, 1}}]

We can make the result look nicer by emphasizing the variables.

Collect[%,{x,y}]

Areas of polygons

Question.  How can we find the area of a polygon  in the plane?

We know that the value of a determinant is the area of the parallelogram determined by the two rows (as vectors).  Thus, since the diagonal of a parallelogram divides the figure into two congruent triangles, the answer for the area of (either) triangle is 1/2 times the determinant.   But this triangle has one vertex at the origin.  Therefore, this answer is not yet general enough.   Here is an example.

Consider, then, a triangle in "general position" with vertices AA, BB, CC.

\(\(Show[
      Graphics[{AbsoluteThickness[2.1], Line[{{0, 0}, {5, 1}}], 
          Line[{{0, 0}, {7, 4}}], Line[{{0, 0}, {2, 7}}]}], 
      Graphics[{AbsoluteThickness[2.1], RGBColor[1, 0, 0], 
          Line[{{5, 1}, {7, 4}, {2, 7}, {5, 1}}]}], 
	
      Graphics[{AbsolutePointSize[8], Point[{5, 1}], 
          Text["AA", {5 +  .55, 1 -  .25}]}], 
	
      Graphics[{AbsolutePointSize[8], Point[{7, 4}], 
          Text["BB", {7 +  .55, 4 +  .25}]}], 
	
      Graphics[{AbsolutePointSize[8], Point[{2, 7}], 
          Text["CC", {2 -  .55, 7 +  .25}]}], 
	Axes -> Automatic, 
      
	AspectRatio -> Automatic, 
	
      PlotRange -> {{0, 8}, {0, 8}}]; \)\)

In the diagram as actually drawn (which is general enough for the discussion) the following vertices were used:

{AA,BB,CC} = {{5,1},{7,4},{2,7}};

Now consider the following combination of determinants

1/2(Det[{AA,BB}] + Det[{BB,CC}] - Det[{AA,CC}])

This can be interpreted as the sum of two triangular areas (with vertices at the origin, minus a third.  The result is the area of the triangle in red, as desired.

The determinant combination can also be interpreted also as a 3x3 determinant, provided we adjoin a further column of 1's.  (This can be proved by expanding the 3x3 determinant in minors with respect to the third column.)

1/2 Det[{Join[AA,{1}],Join[BB,{1}],Join[CC,{1}]}]

Having treated triangles, it is possible to go on to computing areas of polygons in a similar way.  (This is a homework problem.)

Points in space

Question.  What is a test for when three points in space are collinear ?

Suppose the points are {a1, a2, a3}, {b1, b2, b3}, and {c1, c2, c3}.

Answer.   Check whether the following three determinants are zero:

test :=
(Det[{{a1,a2,1},{b1,b2,1},{c1,c2,1}}] ==
 Det[{{a1,a3,1},{b1,b3,1},{c1,c3,1}}] ==
 Det[{{a2,a3,1},{b2,b3,1},{c2,c3,1}}] == 0);

The idea here is to project the points by a perpendicular projection onto each of the coordinate planes and then check if the images are collinear in each case.

Question.  Can the reader prove that the test is sound and effective?

To try an example, here is the code needed:

pt[p_] := Graphics3D[{AbsolutePointSize[5], Point[p]}]; ln[l_] := Graphics3D[{AbsoluteThickness[2], Line[l]}]; lnn[l_] := 
      Graphics3D[{AbsoluteThickness[2], RGBColor[1, 0, 0], Line[l]}]; proj[m_, n_] := 
      Table[If[j == n, 0, m[[i, j]]], {
          i, 3}, {j, 3}]; jn[mm_, nn_] := 
      Table[{mm[[ii]], 
          nn[[ii]]}, {ii, 3}];

\(\(plot[m_, r_, s_] := 
      Show[pt/@m, Table[pt/@proj[m, k], {k, 3}], 
        Table[ln/@jn[m, proj[m, 4 - kk]], {kk, 3}], 
        BoxRatios -> {1, 1, 1}, 
		Axes -> Automatic, 
        PlotRange -> {{r, s}, {r, s}, {r, s}}]; \)\)

\(\(plotl[m_, r_, s_] := 
      Show[pt/@m, Table[pt/@proj[m, k], {k, 3}], 
        Table[ln/@jn[m, proj[m, 4 - kk]], {kk, 3}], 
        Table[lnn[proj[m, kkk]], {kkk, 3}], lnn[m], 
		
        BoxRatios -> {1, 1, 1}, 
		Axes -> Automatic, 
        PlotRange -> {{r, s}, {r, s}, {r, s}}]; \)\)

Let us run some specific examples.

m = {{1, 1, 1}, {3, 2, 3}, {4, 6, 7}};
plot[m,0,8];

The points in space are projected onto the coordinate planes as indicated.

plotl[m,0,8];

The red (broken) lines are drawn in the three planes.  We see they are not all collinear triples.

Now let us take points in space we know are collinear.

{AA,BB} = {{2, 3, 6}, {5, 6, 4}};
g = {AA, BB, (1-2)AA + 2 BB};
plot[g,0,10];

The red lines now fall better:

plotl[g,0,10];

Now we can run the algebraic test to see how it compares with the ideas we encountered in drawing figures to go with the examples.

{{a1, a2, a3}, {b1, b2, b3}, {c1, c2, c3}} = m; test

{{a1,a2,a3},{b1,b2,b3},{c1,c2,c3}} = g; test

The intersection of two lines

Suppose we give ourselves four points in the (ordinary) Cartesian plane:

\(ClearAll[a1, a2, b1, b2, c1, c2, d1, d2]; 

    
{AA, BB, CC, DD} = {{a1, a2}, {b1, b2}, {c1, c2}, {d1, d2}}; \)

Question.  How can we find the point that is the intersection of the lines joining {AA,BB} and  {CC,DD}?

Solution 1.  Solve a set of linear equations.

\(TableForm[{
        Simplify[
          Solve[
		{Det[{Join[AA, {1}], Join[BB, {1}], {x, y, 1}}] == 0, 

              			Det[{Join[CC, {1}], Join[DD, {1}], {x, y, 1}}] == 0}, 

            			{x, y}]]}]\)

Oh, my heavans!  That is a very long solution!  Maybe there is a simpler way to do this?

Solution 2.  Try the parametric representation of the points on a line via vector algebra.

TableForm[{
        Simplify[
          Solve[AA + t (BB - AA) == CC + u (DD - CC), {t, u}]]}]

Hmmm!  The answer is nearly as long.  Is there a better way? [Yes!  Use projective geometry!]

The definition of PE

Meets and joins

The most basic "axioms" of projective geometry concern points, lines, and their incidence properties.  We have in the first place these (dual) properties:

>> Two (distinct) lines meet at (are incident to) a (unique) point.

>> Two (distinct) points join up to (are incident to) a (unique) line.

Our implementation of these axioms constructs the required point (or line) through the operation of exterior product (derived from the properties of determinants).  The operation is called here PE.

Exterior products will be defined only on linear forms (first degree forms), and they are skew symmetic (as are determinants).  We find the following results on the generators (basis forms), which we can give in a tabular display:

TableForm[Outer[PE, {x, y, z}, {x, y, z}]]

TableForm[Outer[PE, {u, v, w}, {u, v, w}]]

And here is a calculation on particular compound forms:

PE[3 x + 5 y - 7 z, x - y + 2 z]

Important Observation.  It is seen that the exterior product of two linear xyz-forms is a linear uvw-form (and the other way around).

And the following symbolic calculation could be regarded as a definition.

PE[(Subscript[a, 1]) u + (Subscript[a, 2]) v + (Subscript[a, 3]) w, (Subscript[b, 1]) u + (Subscript[b, 2]) v + (Subscript[b, 3]) w] // Tidy

Note.  The Mathematica command Tidy rewrites forms in terms of the appropriate variables (using either an xyz combination or a uvw combination).

And we note this is the same result as the evaluation of a determinant |({{(Subscript[a, 1]), (Subscript[a, 2]), (Subscript[a, 3])}, {(Subscript[b, 1]), (Subscript[b, 2]), (Subscript[b, 3])}, {x, y, z}})|:

Det[{{(Subscript[a, 1]), (Subscript[a, 2]), (Subscript[a, 3])}, {(Subscript[b, 1]), (Subscript[b, 2]), (Subscript[b, 3])}, {x, y, z}}] // Tidy

Comment.  However, in terms of the geometry, it is better to think in terms of forms rather than in terms of vectors and coordinates.  Why?  Because we can think of the forms as representing geometric objects.

The geometric interpretation

Another way to give the definition is to say PE of two points is defined exactly so the following equation is true.

Expand[PD[
		PE[(Subscript[a, 1]) u + (Subscript[a, 2]) v + (Subscript[a, 3]) w, (Subscript[b, 1]) u + (Subscript[b, 2]) v + (Subscript[b, 3]) w]
                ,(Subscript[c, 1]) u + (Subscript[c, 2]) v + (Subscript[c, 3]) w]]==Det[{{(Subscript[a, 1]), (Subscript[a, 2]), (Subscript[a, 3])}, {(Subscript[b, 1]), (Subscript[b, 2]), (Subscript[b, 3])}, {(Subscript[c, 1]), (Subscript[c, 2]), (Subscript[c, 3])}}]

Remember that a (non-zero) linear form a x + b y + c z represents a line (up to a scalar multiple), and a (non-zero) dual linear form aa u + bb v + cc v represents a point (up to a scalar multiple).  As we agreed earlier, the necessary and sufficient condition for the point to be incident to the line is that the dot product should vanish:

PD[a x + b y + c z, aa u + bb v + cc v] == 0

Now, the exterior product of two point forms is a line form:

PE[(Subscript[a, 1]) u + (Subscript[a, 2]) v + (Subscript[a, 3]) w, (Subscript[b, 1]) u + (Subscript[b, 2]) v + (Subscript[b, 3]) w] // Tidy

And the dot product with this line form with another point form is the (scalar) determinant:

PD[%, (Subscript[c, 1]) u + (Subscript[c, 2]) v + (Subscript[c, 3]) w] // Expand

The vanishing of this expression is the condition for three rays to be co-planar; that is, the vanishing is the condition fot the three projective points to be collinear.  But this can happen if, and only if, the third point is on the line joining the first two.

Conclusion.  Therefore, the exterior product calculates the line joining two points.

The situation with line forms is exactly similar (in fact, dual).

Conclusion.  The exterior product of two line form is the point at the intersection of two lines (as always, only unique up to a scalar multiple).

We can apply the calculation to ordinary points in the Cartesian plane.  Here is a suite of four:

\(\({AA, BB, CC, DD} = 

      	{a\_1\ u + a\_2\ v + w, 
		b\_1\ u + b\_2\ v + w, 
		
        c\_1\ u + c\_2\ v + w, 
		d\_1\ u + d\_2\ v + w}; \)\)

The line joining the first two is represented by:

ll = PE[AA,BB]//Tidy

In other terms, the ordinary equation of the line joining them will be: 
                   ((Subscript[a, 2]) - (Subscript[b, 2])) x + ((Subscript[b, 1]) - (Subscript[a, 1])) y == 
          -((Subscript[a, 1]) (Subscript[b, 2]) - (Subscript[a, 2]) (Subscript[b, 1]))

And we can check that the points do lie on the line:

Expand[PD[ll,AA]] == Expand[PD[ll,BB]] == 0

Now join up the other pair by a line, and find the intersection of the two lines:

ii = PE[PE[AA,BB],PE[CC,DD]]//Tidy

This is a somewhat long expression, and it is not in a form to recognize an ordinary point.  For that the coefficient of w should be 1.  Here is the coefficient by itself:

ii /. {u -> 0, v -> 0, w -> 1}

So divide through by that (but no need to actually do it).  Note that it is possible that the coefficient might be 0.  That is the test for the two lines to be parallel.

In the file Implementations.nb we have defined the operation PE (in direct and dual forms) by rules, where the calculations are reduced — by the equations for a bilinear operators — to defining it just for the basis elements of the vector spaces of linear forms.

The justification of this definition rests on the theorem that any multilinear operation on vector spaces is completely determined by its action on the basis elements of the spaces in question.

Now, PE is supposed to be skew symmetric.  We make the rules to give skew symmetry on the basis elements, but we do not make this a completely general rule.  An interchange between 
                                        PE[s,t] and -PE[t,s] 
would lead the rule set into an infinite loop.  In Mathematica  we get out of the problem by using the built-in lexicographical ordering of all expresions to put sequences in alphabetical order (and in this case with a correct choice of + or - sign).  But we really need not worry about the details, since the following calculation verifies the skew-symetric property:

Expand[PE[(Subscript[a, 1]) u + (Subscript[a, 2]) v + (Subscript[a, 3]) w, (Subscript[b, 1]) u + (Subscript[b, 2]) v + (Subscript[b, 3]) w]] == 
      -Expand[PE[(Subscript[b, 1]) u + (Subscript[b, 2]) v + (Subscript[b, 3]) w, (Subscript[a, 1]) u + (Subscript[a, 2]) v + (Subscript[a, 3]) w]]