These pages discuss fairly conventional and useful operations involving planes such as projections, intersection and union. We can then go on to embed these elements in higher dimensional spaces, such as homogeneous and conformal space, this provides powerful ways to implement combined rotations and translations and also applications such as raytracing, this may eventually give us better ways to implement physics simulation.

Plane, Surface and Area are all related to something two dimensional which may exist within a higher number of dimensions.

We can start with an infinite plane which goes through the origin as the simplest plane element, we can then go on to planes that do not go through the origin, planes that have finite dimensions, and so on.

## Plane

A plane is a flat (not curved) two dimensional space embedded in a higher number of dimensions.

In two dimensional space there is only one plane that can be contained within it and that is the whole 2D space.

Three dimensional space is a special case because there is a duality between points (which can be represented by 3D vectors) and planes (therefore also represented by 3D vectors). We can visulise the vector representing a plane as a normal to the plane.

(see Clifford algebra or see Feynmans lectures - bookshop below).

When we embed planes in four and higher dimensions the plane can't be defined by a normal vector and the plane will need more scalar values to define it than the number of dimensions.

### Bivectors

We can specify a plane with two lines that lie in the plane, so a combination of two vectors will define the plane. However, defining the plane in this way contains redundant information, which means:

- It requires more scalar values than would otherwise be required.
- There are many pairs of vectors that give the same plane so its difficult, for instance, to compare two planes defined in this way to check if they are identical.

We can get round these problems by combining the two vectors into a single quantity called a bivector.

In three dimensions the bivector can be defined by 3 scalar values. Also in 3 dimensions the plane can be defined by a vector normal to its surface. So the bivector representation has a corresponding vector representation (only in 3D) this correspondance is known as a dual.

I am trying to keep these pages independant of the various algebraic represntations of these geometric elements. It should be mentioned though that Geometric Algebra/Clifford Algebra provides the best algebraic represention and the distinction between vectors and bivectors is crucial. As we study the subject, sooner or later, it will have to be done in terms of Clifford Algebra.

### Duals

As we have just seen, in 3D, vectors and bivectors are duals of each other. In 4D vectors and trivectors are duals of each other. These duals arise from a binomial structure.

If you want to see how this structure arises, I think its best to goto this page in the Clifford algebra part of the site.

### Ways to specify a plane

So far, when we refer to a plane, we mean a plane going through the origin. Sometimes a plane might refer to a specific infinite slice through the space offset from the origin, this is referred to as an affine plane.

Possible ways to specify a plane:

Three Points | We can specify a plane by specifying three points which lie on the plane (provided the points are all different). If the plane is not affine then one of the points can be the origin so effectively we only need two points to define it. Number of scalar points to represent plane: affine: 3*n Instead of 3 points we could also use 1 line and 1 point (because a line can be represented by two points). |

Equation of Plane | In three dimensions we can specify the plane by a single equation of the form: a*x + b*y + c*z + d = 0 If the plane is not affine then there is no offset then we can use: a*x + b*y + c*z = 0 In greater than 3 dimensions then a single equation represents a hyper-plane. The intersection of (n-2) hyper-planes defines the plane. To represent the above intersection we use (n-2) simultaneous equations. |

Tensor | We can represent the above simultaneous equations as a tensor equation, for instance, a11 * x1 + a12 * x2 + a13 * x3 = b1 can be represented by: A * X = B where - A = [aij] is a (n-2) by n matrix,
- X = (x1, x2, ..., xn) is a vector.
- B = (b1, b2, ..., bn) is a vector.
We will show below that number of scalars to represent 'A' which is the same as that given by the bivector notation below. |

Bivector | The clifford algebra part of the site describes how a bivector can define a 'directed area' which is a plane with a quantity. As I understand it the dimension of the bivector is given by the second column Pascal's Triangle which is the binomial coefficient. = n! / (n-r)! r! In this case: n! / (n-2)! 2! But this is for a 'directed area' so we can subtract 1 Number of scalars to represent infinite plane through origin |

## Plane Coordinates

We can change the coordinate system by multiplying by an n×n orthogonal matrix representing a new set of basis vectors. It might be useful if we can map to a coordinate system which is aligned to the plane, in this way two of the coordinates would be along (parallel to) the plane, the remaining coordinates would be perpendicular to the plane.

This would allow us to say, map to 2D coordinates within the plane, do a rotation in the plane, then map back to 'n' dimensions. As explained on this page.

So if we start with an 'n' dimensional space with an orthogonal (set of mutually perpendicular) coordinates defined. To map this to another set of orthogonal coordinates, aligned to the plane, we need an n×n matrix as follows:

As you can see there are two parts to this translation matrix:

- A 2×n dimensional matrix (shown shaded), which transforms from the arbitrary coordinates to points on the plane.
- A (n-2)×n dimensional matrix (not shaded), which transforms to the perpendicular distance from the plane. If we set this to map to zero then it will define the plane itself.

If the whole n×n matrix is orthogonal (that is it can be represented by mutually perpendicular basis vectors) then it can be represented by

n! / (n-2)! 2! scalar values (this is derived on this page).

We can think of this as being made up of:

- 1 degree of freedom to determine the orientation of the basis vectors within the plane.
- (n! / (n-2)! 2!)-1 degrees of freedom to define the plane.

As we can see (and as we know already), when we are working in 3D, we can define the plane with a 3 dimensional vector which is normal to the plane.

## Specifying a plane, using Geometric Algebra, in 'n' dimensions

How can we specify a plane (and rotations) in 'n' dimensions?

In 3D we can specify a plane by using two 3 dimensional base vectors (provided they are not parallel). In 3 dimensions we can use the vector cross product, however in higher dimensions the cross product does not apply and there in not a duality between vectors and bivectors.

Can we use the 'wedge' or exterior product instead?

A point in a 3D plane can be specified by a linear combination of these basis vectors. This requires 3 scalar values for each vector, so 6 scalar values in total. However we can reduce the number of degrees of freedom because the vectors can be unit length so:

b1x^{2} + b1y^{2} +b1z^{2} = 1

b2x^{2} + b2y^{2} +b2z^{2} = 1

where b1 and b2 are the two basis vectors.

We can also reduce the degrees of freedom by specifying the angle between the basis vectors, for instance, lets keep things simple by making the basis vectors mutually perpendicular:

b1x*b2x + b1y*b2y + b1z*b2z = 0

With these restrictions a plane in 3D has three degrees of freedom which is what we want.

So what about 4 dimensions? There are 6 degrees of freedom, represented by a linear combination of pairs of axes:

xy, yz, zx, wx, wy and wz.

So can we specify a plane by using two four dimensional base vectors?

This gives 8 scalar values, but again we can reduce this by 3 degrees of freedom by making the vectors unit length and mutually perpendicular. Which only leaves 5 degrees of freedom, so what have I got wrong?

This gets worse as the number of dimensions increases:

- In 5D there are 10 combinations of basis vectors.
- In 6D there are 15 combinations of basis vectors.

How can the product of two vectors have more degrees of freedom than both of the vectors being multiplied put together?

So is there a geometric interpretation of bivectors in 'n' dimensions? can any of the ways of defining a plane in 3D be extended? For instance as a linear combination of vectors, or by three points that it goes through, or by a linear equation.

Do these methods depend on 'accidents' or special features of 3D such as the duality of vectors and bivectors?

For answers see this newsgroup discussion.

## Converting between the different notations in 3D

### Convert Three points to normal notation

N = (p1-p0) × (p2 - p0)

d = -N • p0^{2}

where:

- N = normal to plane (not necessarily unit length)
- d = perpendicular distance of plane from origin.
- p0,p1 and p2 = vertex points
- x = cross product

### Convert normal to equation notation

a =

b =

c =

d = -N • p0^{2}

### Intersection of two planes

The intersection of two planes is a line (if the planes are not parallel)

The direction of the line is:

direction = Na x Nb

where:

- Na = normal to plane A
- Nb = normal to plane B
- x = cross product

To fully specify this line we need to know some point on it so:

line = pointOnLine + scalar*direction

### Projections onto a plane

We want to calculate a matrix which will translate any possible point in 3D space to a point on the plane.

First take the following special cases, then we will take the general case.

### y-z plane

This can be specified by a vector in the x direction [1,0,0].

Or by the following equation: x=0.

To project onto this plane we an use the following matrix:

0 | 0 | 0 |

0 | 1 | 0 |

0 | 0 | 1 |

### x-z plane

This can be specified by a vector in the y direction [0,1,0].

Or by the following equation: y=0.

To project onto this plane we an use the following matrix:

1 | 0 | 0 |

0 | 0 | 0 |

0 | 0 | 1 |

### x-y plane

This can be specified by a vector in the z direction [0,0,1].

Or by the following equation: z=0.

To project onto this plane we an use the following matrix:

1 | 0 | 0 |

0 | 1 | 0 |

0 | 0 | 0 |

### generalised plane

If the plane orientation is specified by the vector [a,b,c]

Then the equation of the surface is: a * x + b * y + c * z =0

In order to project a point onto this plane we need to calculate the place on the plane with is shortest distance to the point.

Let,

- Pt = a point in 3D space.
- P = the point on the plane which is nearest to Pt
- dist = distance between Pt and P

dist = P2 - Pt

so,

|dist|^{2} = (x - Ptx)^{2} + (y - Pty)^{2} + (z - Ptz)^{2}

So the nearest distance will be at:

d|dist|/dx = d|dist|/dy = d|dist|/dz = 0

This is known as the method of least squares

The solution to this is the following matrix:

projection matrix = [I] - v * v^{t}

projection matrix = [I] - [a,b,c][a,b,c]^{t}