# Hyperplane: Wikis

Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.

# Encyclopedia

A hyperplane is a concept in geometry. It is a generalization of the concept of a plane into a different number of dimensions. Analogous with a plane which defines a two-dimensional subspace in a three-dimensional space, a hyperplane defines a k-dimensional subspace within an n-dimensional space, where k<n. A line, for example, is a one-dimensional hyperplane in a space with any number of dimensions. High dimensional hyperplanes are difficult to visualize, but they share many mathematical properties in common with regular lines and planes.

## Definition

A k-dimensional hyperplane (also called a k-hyperplane) can be defined in n-dimensional space by k+1 points. For example, in 3-space, a line is defined by two points, and a plane is defined by three points. (Each of the points is specified as a vector of n coordinate values to indicate a position in n-dimensional space, and no three of the points can be colinear.)

Equivalently, a k-dimensional hyperplane can be defined with an origin point and a set of k orthonormal basis vectors. This form is commonly used to simplify calculations related to hyperplanes. (It may also be defined with k non-orthonormal basis vectors, but this does not have all the nice mathematical properties.)

Also equivalently, a k-dimensional hyperplane can be defined in n-dimensional space by a set of (n-k) non-degenerate linear equations. (For example, it takes one linear equation to define a line in 2-space, it takes two linear equations to define a line in 3-space, and it takes one linear equation to define a plane in 3-space.) Sample points that lie on a hyperplane can be computed from these equations, and vice versa. Each equation defines an affine hyperplane, and the intersection of these affine hyperplanes defines a hyperplane of smaller dimensionality.

## Computations

All of the techniques in this section are applicable to lines, planes, and hyperplanes.

### Distance to a point

The distance between a point and a hyperplane can be computed in two steps: First, project the point onto the hyperplane. Second, compute the distance between the point and the projected point.

### Projecting a point onto a hyperplane

A point may be projected onto a hyperplane in three steps as follows: First, select an origin on the hyperplane, and compute a set of orthonormal basis vectors that lie on the hyperplane. Second, project the point onto each of the orthonormal basis vectors. Third, add each of these projections to the origin. The result is the projection of the point onto the hyperplane.

### Computing orthonormal basis vectors on a hyperplane

A set of orthonormal basis vectors that lie on a hyperplane can be computed in two steps as follows: First, subtract the first point used to define the hyperplane from each of the remaining points to obtain a set of vectors that lie on the hyperplane. (Thus, the first point serves as the origin for these vectors.) Second, use the Gram–Schmidt process to orthogonalize the vectors.

### Principal components

Given a collection of points, it is common to use the mean as an origin and the first k-principal components as a set of orthonormal basis vectors to define a hyperplane. A hyperplane defined in this manner has the smallest sum-squared distance with the points in the collection of any hyperplane that passes through that origin. This technique is used in local neighborhoods to estimate the tangent space of a manifold from points that are sampled from the manifold.

### Testing for parallelism

One way to test whether two hyperplanes of the same dimensionality are parallel is to project each of the orthonormal basis vectors that define one hyperplane onto the other hyperplane. The hyperplanes are parallel if and only if all of the projected basis vectors have a length of one. With affine hyperplanes, another technique is to first compute a normal vector to the hyperplanes, and then test whether the normal vectors are parallel. This second technique does not work, however, if n - k > 1.

### Intersecting

The intersection of two hyperplanes is also a hyperplane. If the two hyperplanes are defined with a set of equations, then the hyperplane of the intersection is simply defined by the union of the two sets of equations. If the hyperplanes are defined using points, it is also possible to compute points that lie on the intersecting hyperplane. This is done as follows: Suppose points a and b lie on the first hyperplane. Compute the scalar value c such that the point c(b-a)+a has a distance of zero from the other hyperplane.

### Rotation

In 3-space, rotation occurs around a line. In n-space, rotation occurs around an (n-2) dimensional hyperplane. This is equivalent to rotating on the surface of a 2-dimensional plane. Suppose we wish to rotate point p on a plane defined by orthonormal basis vectors a and b by t radians. This can be done as follows:

$r=\sqrt{(\mathbf{p} \cdot \mathbf{a})^2 + (\mathbf{p} \cdot \mathbf{b})^2}$

$\theta=tan^{-1}\left(\frac{\mathbf{p} \cdot \mathbf{b}}{\mathbf{p} \cdot \mathbf{a}}\right) + t$

$\mathbf{p} = \mathbf{p} + (r \cos(\theta) - (\mathbf{p} \cdot \mathbf{a}))\mathbf{a} + (r \sin(\theta) - (\mathbf{p} \cdot \mathbf{b}))\mathbf{b}$

A hyperplane can be rotated using this technique to rotate each of its basis vectors.

### Dihedral Angles

The dihedral angle between two hyperplanes of codimension 1 is the angle between the corresponding normal vectors. For hyperplanes with codimension greater than 1, the dihedral angle can be computed as follows. Suppose A is a matrix of orthonormal basis vectors for hyperplane a, such that each column specifies one of the basis vectors, and B holds the basis vectors for hyperplane b. First, compute a vector u, in space A, that is minimally correlated with B:

u= the eigenvector with the smallest corresponding eigenvalue of $(\mathbf{B}^T\mathbf{A})^T(\mathbf{B}^T\mathbf{A})$

Also compute vector v, in space B, that is minimally correlated with A:

v= the eigenvector with the smallest corresponding eigenvalue of $(\mathbf{A}^T\mathbf{B})^T(\mathbf{A}^T\mathbf{B})$

The angle between Au and Bv is the dihedral angle between hyperplane a and b. Further, the vectors Au and Bv define a plane on which one of the hyperplanes can be minimally rotated to be made parallel with the other (although it should be noted that they must be made orthonormal before the technique described above for rotation can be used).

## Special types of hyperplanes

Several specific types of hyperplanes are defined with properties that are well suited for particular purposes. Some of these specializations are described here.

### Affine hyperplanes

An affine hyperplane is an affine subspace of codimension 1 in an affine geometry. In other words, it is a (d − 1)-dimensional hyperplane in d-dimensional space.

An affine hyperplane can be described with a single linear equation of the following form:

a1x1 + a2x2 + ... + anxn = b.

By comparison, general k-hyperplanes are described with (n - k) of such equations.

All affine hyperplanes have exactly two possible normal vectors. Non-affine hyperplanes have an infinite number of normal vectors. (For example, consider the normal vectors of a line in 2-space, and then consider the normal vectors of a line in 3-space. There are two, and infinite, respectively.) Affine hyperplanes also divide the space into exactly two parts, whereas non-affine hyperplanes do not divide the space.

The two half-spaces defined by an affine hyperplane in n-dimensional space with real-number coordinates are:

a1x1 + a2x2 + ... + anxnb

and

a1x1 + a2x2 + ... + anxnb.

As an example, a line is an affine hyperplane in 2-space, but it is not an affine hyperplane in 3-space because one can travel around it without passing through it. All of physical space at a specified instant in time is a 3-dimensional hyperplane that divides the universe into two parts (before and after the specified time). A 2-dimensional plane at a specified instant in time, however, is not an affine hyperplane in a four-dimensional universe because one could hypothetically travel around it without passing through it (assuming arbitrary travel in each of the four dimensions is possible) by traveling to a time when that plane is not defined and then crossing over.

Affine hyperplanes are used to define decision boundaries in many machine learning algorithms such as linear-combination (oblique) decision trees, and Perceptrons.

The dihedral angle between two affine hyperplanes can be computed as the angle between the normal vectors of those hyperplanes.

### Linear hyperplanes

A linear hyperplane is one that passes through the origin. Such hyperplanes can be represented with a (n-k) by n matrix that stores the coefficients of the equations that define the hyperplane, or an n by k matrix of basis vectors that lie on the hyperplane. To fully define a hyperplane that does not pass through the origin, an additional (n-k) dimensional vector is required to store the values of b for each equation.

### Projective hyperplanes

Projective hyperplanes, are used in projective geometry. Projective geometry can be viewed as affine geometry with vanishing points (points at infinity) added. An affine hyperplane together with the associated points at infinity forms a projective hyperplane. One special case of a projective hyperplane is the infinite or ideal hyperplane, which is defined with the set of all points at infinity.

In real projective space, a hyperplane does not divide the space into two parts; rather, it takes two hyperplanes to separate points and divide up the space. The reason for this is that in real projective space, the space essentially "wraps around" so that both sides of a lone hyperplane are connected to each other.