Points in the plane can be specified by means of Cartesian coordinates (x, y), and points in 3-dimensional space may be assigned Cartesian coordinates (x, y, z). It can be useful, similarly, to consider space of n dimensions, for general values of n, by defining a point to be given by n coordinates. Many familiar ideas from geometry of 2 and 3 dimensions can be generalized to space of higher dimensions. For example, if the point P has coordinates (x1, x2,…, xn), and the point Q has coordinates (y1, y2,…, yn), then the distance PQ can be defined to be equal to
Straight lines can be defined, and so can the notion of angle between them. The set of points whose coordinates satisfy a linear equation a1x1+a2x2+…+anxn=b is called a hyperplane, which divides the space into two half-spaces, as a plane does in 3 dimensions. There are other so-called subspaces of different dimensions, a straight line being a subspace of dimension 1 and a hyperplane being a subspace of dimension n−1. Other curves and surfaces can also be considered. In n dimensions, the generalization of a square in 2 dimensions and a cube in 3 dimensions is a hypercube.