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 twodimensional subspace in a threedimensional space, a hyperplane defines a kdimensional subspace within an ndimensional space, where k<n. A line, for example, is a onedimensional 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.
Contents 
A kdimensional hyperplane (also called a khyperplane) can be defined in ndimensional space by k+1 points. For example, in 3space, 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 ndimensional space, and no three of the points can be colinear.)
Equivalently, a kdimensional 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 nonorthonormal basis vectors, but this does not have all the nice mathematical properties.)
Also equivalently, a kdimensional hyperplane can be defined in ndimensional space by a set of (nk) nondegenerate linear equations. (For example, it takes one linear equation to define a line in 2space, it takes two linear equations to define a line in 3space, and it takes one linear equation to define a plane in 3space.) 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.
All of the techniques in this section are applicable to lines, planes, and hyperplanes.
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.
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.
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.
Given a collection of points, it is common to use the mean as an origin and the first kprincipal components as a set of orthonormal basis vectors to define a hyperplane. A hyperplane defined in this manner has the smallest sumsquared 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.
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.
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(ba)+a has a distance of zero from the other hyperplane.
In 3space, rotation occurs around a line. In nspace, rotation occurs around an (n2) dimensional hyperplane. This is equivalent to rotating on the surface of a 2dimensional 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:
A hyperplane can be rotated using this technique to rotate each of its basis vectors.
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
Also compute vector v, in space B, that is minimally correlated with A:
v= the eigenvector with the smallest corresponding eigenvalue of
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).
Several specific types of hyperplanes are defined with properties that are well suited for particular purposes. Some of these specializations are described here.
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 ddimensional space.
An affine hyperplane can be described with a single linear equation of the following form:
By comparison, general khyperplanes are described with (n  k) of such equations.
All affine hyperplanes have exactly two possible normal vectors. Nonaffine hyperplanes have an infinite number of normal vectors. (For example, consider the normal vectors of a line in 2space, and then consider the normal vectors of a line in 3space. There are two, and infinite, respectively.) Affine hyperplanes also divide the space into exactly two parts, whereas nonaffine hyperplanes do not divide the space.
The two halfspaces defined by an affine hyperplane in ndimensional space with realnumber coordinates are:
and
As an example, a line is an affine hyperplane in 2space, but it is not an affine hyperplane in 3space because one can travel around it without passing through it. All of physical space at a specified instant in time is a 3dimensional hyperplane that divides the universe into two parts (before and after the specified time). A 2dimensional plane at a specified instant in time, however, is not an affine hyperplane in a fourdimensional 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 linearcombination (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.
A linear hyperplane is one that passes through the origin. Such hyperplanes can be represented with a (nk) 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 (nk) dimensional vector is required to store the values of b for each equation.
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.
