# n-sphere

In mathematics, an ** n-sphere** is a topological space that is homeomorphic to a

*standard*

*n*-

*sphere*, which is the set of points in (

*n*+ 1)-dimensional Euclidean space that are situated at a constant distance r from a fixed point, called the

*center*. It is the generalization of an ordinary sphere in the ordinary three-dimensional space. The "radius" of a sphere is the constant distance of its points to the center. When the sphere has unit radius, it is usual to call it

**the unit**or simply

*n*-sphere**the**for brevity. In terms of the standard norm, the

*n*-sphere*n*-sphere is defined as

The dimension of *n*-sphere is n, and must not be confused with the dimension (*n* + 1) of the Euclidean space in which it is naturally embedded. An *n*-sphere is the surface or boundary of an (*n* + 1)-dimensional ball.

For *n* ≥ 2, the *n*-spheres that are differential manifolds can be characterized (up to a diffeomorphism) as the simply connected *n*-dimensional manifolds of constant, positive curvature. The *n*-spheres admit several other topological descriptions: for example, they can be constructed by gluing two *n*-dimensional Euclidean spaces together, by identifying the boundary of an *n*-cube with a point, or (inductively) by forming the suspension of an (*n* − 1)-sphere. The 1-sphere is the 1-manifold that is a circle, which is not simply connected. The 0-sphere is the 0-manifold consisting of two points, which is not even connected.

For any natural number *n*, an *n*-sphere of radius *r* is defined as the set of points in (*n* + 1)-dimensional Euclidean space that are at distance *r* from some fixed point **c**, where *r* may be any positive real number and where **c** may be any point in (*n* + 1)-dimensional space. In particular:

The above *n*-sphere exists in (*n* + 1)-dimensional Euclidean space and is an example of an *n*-manifold. The volume form *ω* of an *n*-sphere of radius *r* is given by

where ∗ is the Hodge star operator; see Flanders (1989, §6.1) for a discussion and proof of this formula in the case *r* = 1. As a result,

The space enclosed by an *n*-sphere is called an (*n* + 1)-ball. An (*n* + 1)-ball is closed if it includes the *n*-sphere, and it is open if it does not include the *n*-sphere.

*V _{n}*(

*R*) and

*S*(

_{n}*R*) are the

*n*-dimensional volume of the

*n*-ball and the surface area of the

*n*-sphere embedded in dimension

*n*+ 1, respectively, of radius

*R*.

The constants *V _{n}* and

*S*(for

_{n}*R*= 1, the unit ball and sphere) are related by the recurrences:

where *Γ* is the gamma function. Derivations of these equations are given in this section.

In theory, one could compare the values of *S _{n}*(

*R*) and

*S*(

_{m}*R*) for

*n*≠

*m*. However, this is not well-defined. For example, if

*n*= 2 and

*m*= 3 then the comparison is like comparing a number of square meters to a different number of cubic meters. The same applies to a comparison of

*V*(

_{n}*R*) and

*V*(

_{m}*R*) for

*n*≠

*m*.

The 0-ball consists of a single point. The 0-dimensional Hausdorff measure is the number of points in a set. So,

The unit 1-sphere is the unit circle in the Euclidean plane, and this has circumference (1-dimensional measure)

The region enclosed by the unit 1-sphere is the 2-ball, or unit disc, and this has area (2-dimensional measure)

Analogously, in 3-dimensional Euclidean space, the surface area (2-dimensional measure) of the unit 2-sphere is given by

and the volume enclosed is the volume (3-dimensional measure) of the unit 3-ball, given by

The *surface area*, or properly the *n*-dimensional volume, of the *n*-sphere at the boundary of the (*n* + 1)-ball of radius *R* is related to the volume of the ball by the differential equation

or, equivalently, representing the unit *n*-ball as a union of concentric (*n* − 1)-sphere *shells*,

We can also represent the unit (*n* + 2)-sphere as a union of products of a circle (1-sphere) with an *n*-sphere. Let *r* = cos *θ* and *r*^{2} + *R*^{2} = 1, so that *R* = sin *θ* and *dR* = cos *θ* *dθ*. Then,

where !! denotes the double factorial, defined for odd natural numbers 2*k* + 1 by (2*k* + 1)!! = 1 × 3 × 5 × ... × (2*k* − 1) × (2*k* + 1) and similarly for even numbers (2*k*)!! = 2 × 4 × 6 × ... × (2*k* − 2) × (2*k*).

In general, the volume, in *n*-dimensional Euclidean space, of the unit *n*-ball, is given by

where *Γ* is the gamma function, which satisfies *Γ*(1/2) = √π, *Γ*(1) = 1, and *Γ*(*x* + 1) = *xΓ*(*x*), and so *Γ*(*x* + 1) = *x!*, and where we conversely define x! = *Γ*(*x* + 1) for any x.

By multiplying *V _{n}* by

*R*, differentiating with respect to

^{n}*R*, and then setting

*R*= 1, we get the closed form

The recurrences can be combined to give a "reverse-direction" recurrence relation for surface area, as depicted in the diagram:

The recurrence relation for *V*_{n} can also be proved via integration with 2-dimensional polar coordinates:

We may define a coordinate system in an *n*-dimensional Euclidean space which is analogous to the spherical coordinate system defined for 3-dimensional Euclidean space, in which the coordinates consist of a radial coordinate *r*, and *n* − 1 angular coordinates *φ*_{1}, *φ*_{2}, ... *φ*_{n−1}, where the angles *φ*_{1}, *φ*_{2}, ... *φ*_{n−2} range over [0,π] radians (or over [0,180] degrees) and *φ*_{n−1} ranges over [0,2π) radians (or over [0,360) degrees). If *x _{i}* are the Cartesian coordinates, then we may compute

*x*

_{1}, ...

*x*from

_{n}*r*,

*φ*

_{1}, ...

*φ*

_{n−1}with:

^{[2]}

Except in the special cases described below, the inverse transformation is unique:

where if *x _{k}* ≠ 0 for some

*k*but all of

*x*

_{k+1}, ...

*x*are zero then

_{n}*φ*= 0 when

_{k}*x*> 0, and

_{k}*φ*= π (180 degrees) when

_{k}*x*< 0.

_{k}There are some special cases where the inverse transform is not unique; *φ _{k}* for any

*k*will be ambiguous whenever all of

*x*,

_{k}*x*

_{k+1}, ...

*x*are zero; in this case

_{n}*φ*may be chosen to be zero.

_{k}To express the volume element of *n*-dimensional Euclidean space in terms of spherical coordinates, first observe that the Jacobian matrix of the transformation is:

The determinant of this matrix can be calculated by induction. When *n* = 2, a straightforward computation shows that the determinant is *r*. For larger *n*, observe that *J*_{n} can be constructed from *J*_{n − 1} as follows. Except in column *n*, rows *n* − 1 and *n* of *J*_{n} are the same as row *n* − 1 of *J*_{n − 1}, but multiplied by an extra factor of cos φ_{n − 1} in row *n* − 1 and an extra factor of sin φ_{n − 1} in row *n*. In column *n*, rows *n* − 1 and *n* of *J*_{n} are the same as column *n* − 1 of row *n* − 1 of *J*_{n − 1}, but multiplied by extra factors of sin φ_{n − 1} in row *n* − 1 and cos φ_{n − 1} in row *n*, respectively. The determinant of *J*_{n} can be calculated by Laplace expansion in the final column. By the recursive description of *J*_{n}, the submatrix formed by deleting the entry at (*n* − 1, *n*) and its row and column almost equals *J*_{n − 1}, except that its last row is multiplied by sin φ_{n − 1}. Similarly, the submatrix formed by deleting the entry at (*n*, *n*) and its row and column almost equals *J*_{n − 1}, except that its last row is multiplied by cos φ_{n − 1}. Therefore the determinant of *J*_{n} is

Induction then gives a closed-form expression for the volume element in spherical coordinates

The formula for the volume of the *n*-ball can be derived from this by integration.

Similarly the surface area element of the (*n* − 1)-sphere of radius *R*, which generalizes the area element of the 2-sphere, is given by

The natural choice of an orthogonal basis over the angular coordinates is a product of ultraspherical polynomials,

for *j* = 1, 2,... *n* − 2, and the *e*^{isφj} for the angle *j* = *n* − 1 in concordance with the spherical harmonics.

The standard spherical coordinate system arises from writing ℝ^{n} as the product ℝ × ℝ^{n − 1}. These two factors may be related using polar coordinates. For each point **x** of ℝ^{n}, the standard Cartesian coordinates

This says that points in ℝ^{n} may be expressed by taking the ray starting at the origin and passing through **z** ∈ ℝ^{n − 1}, rotating it towards the first basis vector by θ, and traveling a distance *r* along the ray. Repeating this decomposition eventually leads to the standard spherical coordinate system.

Polyspherical coordinate systems arise from a generalization of this construction.^{[3]} The space ℝ^{n} is split as the product of two Euclidean spaces of smaller dimension, but neither space is required to be a line. Specifically, suppose that *p* and *q* are positive integers such that *n* = *p* + *q*. Then ℝ^{n} = ℝ^{p} × ℝ^{q}. Using this decomposition, a point **x** ∈ ℝ^{n} may be written as

This can be transformed into a mixed polar–Cartesian coordinate system by writing:

Polyspherical coordinates also have an interpretation in terms of the special orthogonal group. A splitting ℝ^{n} = ℝ^{p} × ℝ^{q} determines a subgroup

In polyspherical coordinates, the volume measure on ℝ^{n} and the area measure on S^{n − 1} are products. There is one factor for each angle, and the volume measure on ℝ^{n} also has a factor for the radial coordinate. The area measure has the form:

where the factors *F*_{i} are determined by the tree. Similarly, the volume measure is

Suppose we have a node of the tree that corresponds to the decomposition ℝ^{n1 + n2} = ℝ^{n1} × ℝ^{n2} and that has angular coordinate θ. The corresponding factor *F* depends on the values of *n*_{1} and *n*_{2}. When the area measure is normalized so that the area of the sphere is 1, these factors are as follows. If *n*_{1} = *n*_{2} = 1, then

Just as a two-dimensional sphere embedded in three dimensions can be mapped onto a two-dimensional plane by a stereographic projection, an *n*-sphere can be mapped onto an *n*-dimensional hyperplane by the *n*-dimensional version of the stereographic projection. For example, the point [*x*,*y*,*z*] on a two-dimensional sphere of radius 1 maps to the point [
*x*/1 − *z*,
*y*/1 − *z*] on the *xy*-plane. In other words,

Likewise, the stereographic projection of an *n*-sphere **S**^{n−1} of radius 1 will map to the (*n* − 1)-dimensional hyperplane ℝ^{n−1} perpendicular to the *x _{n}*-axis as

To generate uniformly distributed random points on the unit (*n* − 1)-sphere (that is, the surface of the unit *n*-ball), Marsaglia (1972) gives the following algorithm.

Generate an *n*-dimensional vector of normal deviates (it suffices to use N(0, 1), although in fact the choice of the variance is arbitrary), **x** = (*x*_{1}, *x*_{2},... *x _{n}*). Now calculate the "radius" of this point:

The vector
1/*r***x** is uniformly distributed over the surface of the unit *n*-ball.

With a point selected uniformly at random from the surface of the unit (*n* - 1)-sphere (e.g., by using Marsaglia's algorithm), one needs only a radius to obtain a point uniformly at random from within the unit *n*-ball. If *u* is a number generated uniformly at random from the interval [0, 1] and **x** is a point selected uniformly at random from the unit (*n* - 1)-sphere, then *u*^{1⁄n}**x** is uniformly distributed within the unit *n*-ball.

Alternatively, points may be sampled uniformly from within the unit *n*-ball by a reduction from the unit (*n* + 1)-sphere. In particular, if (*x*_{1},*x*_{2},...,*x*_{n+2}) is a point selected uniformly from the unit (*n* + 1)-sphere, then (*x*_{1},*x*_{2},...,*x*_{n}) is uniformly distributed within the unit *n*-ball (i.e., by simply discarding two coordinates).^{[4]}

If *n* is sufficiently large, most of the volume of the *n*-ball will be contained in the region very close to its surface, so a point selected from that volume will also probably be close to the surface. This is one of the phenomena leading to the so-called curse of dimensionality that arises in some numerical and other applications.

The **octahedral n-sphere** is defined similarly to the

*n*-sphere but using the 1-norm

The octahedral 1-sphere is a square (without its interior). The octahedral 2-sphere is a regular octahedron; hence the name. The octahedral *n*-sphere is the topological join of *n*+1 pairs of isolated points.^{[6]} Intuitively, the topological join of two pairs is generated by drawing a segment between each point in one pair and each point in the other pair; this yields a square. To join this with a third pair, draw a segment between each point on the square and each point in the third pair; this gives a octahedron.