# N-sphere

In mathematics, an n-sphere or hypersphere is an ⁠$n$⁠-dimensional generalization of the ⁠$1$⁠-dimensional circle and ⁠$2$⁠-dimensional sphere to any non-negative integer ⁠$n$⁠.
The circle is considered 1-dimensional, and the sphere 2-dimensional, because the surfaces themselves are 1- and 2-dimensional respectively, not because they exist as shapes in 1- and 2-dimensional space. The typical embedding of the 1-dimensional circle is in 2-dimensional space, the 2-dimensional sphere is usually depicted embedded in 3-dimensional space, and a general ⁠$n$⁠-sphere is embedded in an ⁠$n+1$⁠-dimensional space. The term hypersphere is commonly used to distinguish spheres of dimension ⁠$n\geq 3$⁠ which are thus embedded in a space of dimension ⁠$n+1\geq 4$⁠, which means that they cannot be easily visualized. The ⁠$n$⁠-sphere is the setting for ⁠$n$⁠-dimensional spherical geometry.
Considered extrinsically, as a hypersurface embedded in ⁠$(n+1)$⁠-dimensional Euclidean space, an ⁠$n$⁠-sphere is the locus of points at equal distance (the radius) from a given center point. Its interior, consisting of all points closer to the center than the radius, is an ⁠$(n+1)$⁠-dimensional ball. In particular:
* The ⁠$0$⁠-sphere is the pair of points at the ends of a line segment (⁠$1$⁠-ball).
* The ⁠$1$⁠-sphere is a circle, the circumference of a disk (⁠$2$⁠-ball) in the two-dimensional plane.
* The ⁠$2$⁠-sphere, often simply called a sphere, is the boundary of a ⁠$3$⁠-ball in three-dimensional space.
* The 3-sphere is the boundary of a ⁠$4$⁠-ball in four-dimensional space.
* The ⁠$(n-1)$⁠-sphere is the boundary of an ⁠$n$⁠-ball.
Given a Cartesian coordinate system, the unit ⁠$n$⁠-sphere of radius ⁠$1$⁠ can be defined as:
    $S^{n}=\left\{x\in \mathbb {R} ^{n+1}:\left\|x\right\|=1\right\}.$
Considered intrinsically, when ⁠$n\geq 1$⁠, the ⁠$n$⁠-sphere is a Riemannian manifold of positive constant curvature, and is orientable. The geodesics of the ⁠$n$⁠-sphere are called great circles.
The stereographic projection maps the ⁠$n$⁠-sphere onto ⁠$n$⁠-space with a single adjoined point at infinity; under the metric thereby defined, $\mathbb {R} ^{n}\cup \{\infty \}$ is a model for the ⁠$n$⁠-sphere.
In the more general setting of topology, any topological space that is homeomorphic to the unit ⁠$n$⁠-sphere is called an ⁠$n$⁠-sphere. Under inverse stereographic projection, the ⁠$n$⁠-sphere is the one-point compactification of ⁠$n$⁠-space. The ⁠$n$⁠-spheres admit several other topological descriptions: for example, they can be constructed by gluing two ⁠$n$⁠-dimensional spaces together, by identifying the boundary of an ⁠$n$⁠-cube with a point, or (inductively) by forming the suspension of an ⁠$(n-1)$⁠-sphere. When ⁠$n\geq 2$⁠ it is simply connected; the ⁠$1$⁠-sphere (circle) is not simply connected; the ⁠$0$⁠-sphere is not even connected, consisting of two discrete points.

## Description

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 ⁠$\mathbf {c}$⁠, where ⁠$r$⁠ may be any positive real number and where ⁠$\mathbf {c}$⁠ may be any point in ⁠$(n+1)$⁠-dimensional space. In particular:
* a 0-sphere is a pair of points ⁠$\{c-r,c+r\}$⁠, and is the boundary of a line segment (⁠$1$⁠-ball).
* a 1-sphere is a circle of radius ⁠$r$⁠ centered at ⁠$\mathbf {c}$⁠, and is the boundary of a disk (⁠$2$⁠-ball).
* a 2-sphere is an ordinary ⁠$2$⁠-dimensional sphere in ⁠$3$⁠-dimensional Euclidean space, and is the boundary of an ordinary ball (⁠$3$⁠-ball).
* a 3-sphere is a ⁠$3$⁠-dimensional sphere in ⁠$4$⁠-dimensional Euclidean space.

### Cartesian coordinates

The set of points in ⁠$(n+1)$⁠-space, ⁠$(x_{1},x_{2},\ldots ,x_{n+1})$⁠, that define an ⁠$n$⁠-sphere, ⁠$S^{n}(r)$⁠, is represented by the equation:
    $r^{2}=\sum _{i=1}^{n+1}(x_{i}-c_{i})^{2},$
where ⁠$\mathbf {c} =(c_{1},c_{2},\ldots ,c_{n+1})$⁠ is a center point, and ⁠$r$⁠ is the radius.
The above ⁠$n$⁠-sphere exists in ⁠$(n+1)$⁠-dimensional Euclidean space and is an example of an ⁠$n$⁠-manifold. The volume form ⁠$\omega$⁠ of an ⁠$n$⁠-sphere of radius ⁠$r$⁠ is given by
    $\omega ={\frac {1}{r}}\sum _{j=1}^{n+1}(-1)^{j-1}x_{j}\,dx_{1}\wedge \cdots \wedge dx_{j-1}\wedge dx_{j+1}\wedge \cdots \wedge dx_{n+1}={\star }dr$
where ${\star }$ 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,
    $dr\wedge \omega =dx_{1}\wedge \cdots \wedge dx_{n+1}.$

### n-ball

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.
Specifically:
* A ⁠$1$⁠-ball, a line segment, is the interior of a 0-sphere.
* A ⁠$2$⁠-ball, a disk, is the interior of a circle (⁠$1$⁠-sphere).
* A ⁠$3$⁠-ball, an ordinary ball, is the interior of a sphere (⁠$2$⁠-sphere).
* A ⁠$4$⁠-ball is the interior of a 3-sphere, etc.

### Topological description

Topologically, an ⁠$n$⁠-sphere can be constructed as a one-point compactification of ⁠$n$⁠-dimensional Euclidean space. Briefly, the ⁠$n$⁠-sphere can be described as ⁠$S^{n}=\mathbb {R} ^{n}\cup \{\infty \}$⁠, which is ⁠$n$⁠-dimensional Euclidean space plus a single point representing infinity in all directions. In particular, if a single point is removed from an ⁠$n$⁠-sphere, it becomes homeomorphic to $\mathbb {R} ^{n}$. This forms the basis for stereographic projection.

## Volume and area

Let ⁠$S_{n-1}$⁠ be the surface area of the unit ⁠$(n-1)$⁠-sphere of radius ⁠$1$⁠ embedded in ⁠$n$⁠-dimensional Euclidean space, and let ⁠$V_{n}$⁠ be the volume of its interior, the unit ⁠$n$⁠-ball. The surface area of an arbitrary ⁠$(n-1)$⁠-sphere is proportional to the ⁠$(n-1)$⁠st power of the radius, and the volume of an arbitrary ⁠$n$⁠-ball is proportional to the ⁠$n$⁠th power of the radius.
The ⁠$0$⁠-ball is sometimes defined as a single point. The ⁠$0$⁠-dimensional Hausdorff measure is the number of points in a set. So
    $V_{0}=1.$
A unit ⁠$1$⁠-ball is a line segment whose points have a single coordinate in the interval ⁠$[-1,1]$⁠ of length ⁠$2$⁠, and the ⁠$0$⁠-sphere consists of its two end-points, with coordinate ⁠$\{-1,1\}$⁠.
    $S_{0}=2,\quad V_{1}=2.$
A unit ⁠$1$⁠-sphere is the unit circle in the Euclidean plane, and its interior is the unit disk (⁠$2$⁠-ball).
    $S_{1}=2\pi ,\quad V_{2}=\pi .$
The interior of a 2-sphere in three-dimensional space is the unit ⁠$3$⁠-ball.
    $S_{2}=4\pi ,\quad V_{3}={\tfrac {4}{3}}\pi .$
In general, ⁠$S_{n-1}$⁠ and ⁠$V_{n}$⁠ are given in closed form by the expressions
    $S_{n-1}={\frac {2\pi ^{n/2}}{\Gamma {\bigl{\frac {n}{2}}{\bigr )}}},\quad V_{n}={\frac {\pi ^{n/2}}{\Gamma {\bigl{\frac {n}{2}}+1{\bigr )}}}$
where ⁠$\Gamma$⁠ is the gamma function.
As ⁠$n$⁠ tends to infinity, the volume of the unit ⁠$n$⁠-ball (ratio between the volume of an ⁠$n$⁠-ball of radius ⁠$1$⁠ and an ⁠$n$⁠-cube of side length ⁠$1$⁠) tends to zero.

### Recurrences

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
    $S_{n}R^{n}={\frac {dV_{n+1}R^{n+1}}{dR}}={(n+1)V_{n+1}R^{n}}.$
Equivalently, representing the unit ⁠$n$⁠-ball as a union of concentric ⁠$(n-1)$⁠-sphere shells,
    $V_{n+1}=\int _{0}^{1}S_{n}r^{n}\,dr={\frac {1}{n+1}}S_{n}.$
We can also represent the unit ⁠$(n+2)$⁠-sphere as a union of products of a circle (⁠$1$⁠-sphere) with an ⁠$n$⁠-sphere. Then ⁠$S_{n+2}=2\pi V_{n+1}$⁠. Since ⁠$S_{1}=2\pi V_{0}$⁠, the equation
    $S_{n+1}=2\pi V_{n}$
holds for all ⁠$n$⁠. Along with the base cases ⁠$S_{0}=2$⁠, ⁠$V_{1}=2$⁠ from above, these recurrences can be used to compute the surface area of any sphere or volume of any ball.

## Spherical 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 ⁠$\varphi _{1},\varphi _{2},\ldots ,\varphi _{n-1}$⁠, where the angles ⁠$\varphi _{1},\varphi _{2},\ldots ,\varphi _{n-2}$⁠ range over ⁠$[0,\pi ]$⁠ radians (or ⁠$[0,180]$⁠ degrees) and ⁠$\varphi _{n-1}$⁠ ranges over ⁠$[0,2\pi )$⁠ radians (or ⁠$[0,360)$⁠ degrees). If ⁠$x_{i}$⁠ are the Cartesian coordinates, then we may compute ⁠$x_{1},\ldots ,x_{n}$⁠ from ⁠$r,\varphi _{1},\ldots ,\varphi _{n-1}$⁠ with:
    ${\begin{aligned}x_{1}&=r\cos(\varphi _{1}),\\[5mu]x_{2}&=r\sin(\varphi _{1})\cos(\varphi _{2}),\\[5mu]x_{3}&=r\sin(\varphi _{1})\sin(\varphi _{2})\cos(\varphi _{3}),\\&\qquad \vdots \\x_{n-1}&=r\sin(\varphi _{1})\cdots \sin(\varphi _{n-2})\cos(\varphi _{n-1}),\\[5mu]x_{n}&=r\sin(\varphi _{1})\cdots \sin(\varphi _{n-2})\sin(\varphi _{n-1}).\end{aligned}}$
Except in the special cases described below, the inverse transformation is unique:
    ${\begin{aligned}r&={\textstyle {\sqrt {{x_{n}}^{2}+{x_{n-1}}^{2}+\cdots +{x_{2}}^{2}+{x_{1}}^{2}}}},\\[5mu]\varphi _{1}&=\operatorname {atan2} \left({\textstyle {\sqrt {{x_{n}}^{2}+{x_{n-1}}^{2}+\cdots +{x_{2}}^{2}}}},x_{1}\right),\\[5mu]\varphi _{2}&=\operatorname {atan2} \left({\textstyle {\sqrt {{x_{n}}^{2}+{x_{n-1}}^{2}+\cdots +{x_{3}}^{2}}}},x_{2}\right),\\&\qquad \vdots \\\varphi _{n-2}&=\operatorname {atan2} \left({\textstyle {\sqrt {{x_{n}}^{2}+{x_{n-1}}^{2}}}},x_{n-2}\right),\\[5mu]\varphi _{n-1}&=\operatorname {atan2} \left(x_{n},x_{n-1}\right).\end{aligned}}$
where atan2 is the two-argument arctangent function.
There are some special cases where the inverse transform is not unique; ⁠$\varphi _{k}$⁠ for any ⁠$k$⁠ will be ambiguous whenever all of ⁠$x_{k},x_{k+1},\ldots x_{n}$⁠ are zero; in this case ⁠$\varphi _{k}$⁠ may be chosen to be zero. (For example, for the ⁠$2$⁠-sphere, when the polar angle is ⁠$0$⁠ or ⁠$\pi$⁠ then the point is one of the poles, zenith or nadir, and the choice of azimuthal angle is arbitrary.)

### Spherical volume and area elements

The arc length element is$ds^{2}=dr^{2}+\sum _{k=1}^{n-1}r^{2}\left(\prod _{m=1}^{k-1}\sin ^{2}\left(\varphi _{m}\right)\right)d\varphi _{k}^{2}$To express the volume element of ⁠$n$⁠-dimensional Euclidean space in terms of spherical coordinates, let ⁠$s_{k}=\sin \varphi _{k}$⁠ and ⁠$c_{k}=\cos \varphi _{k}$⁠ for concision, then observe that the Jacobian matrix of the transformation is:
    $J_{n}={\begin{pmatrix}c_{1}&-rs_{1}&0&0&\cdots &0\\s_{1}c_{2}&rc_{1}c_{2}&-rs_{1}s_{2}&0&\cdots &0\\\vdots &\vdots &\vdots &&\ddots &\vdots \\&&&&&0\\s_{1}\cdots s_{n-2}c_{n-1}&\cdots &\cdots &&&-rs_{1}\cdots s_{n-2}s_{n-1}\\s_{1}\cdots s_{n-2}s_{n-1}&rc_{1}\cdots s_{n-1}&\cdots &&&{\phantom {-}}rs_{1}\cdots s_{n-2}c_{n-1}\end{pmatrix}}.$
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 \varphi _{n-1}$⁠ in row ⁠$n-1$⁠ and an extra factor of ⁠$\sin \varphi _{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 \varphi _{n-1}$⁠ in row ⁠$n-1$⁠ and ⁠$\cos \varphi _{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 \varphi _{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 \varphi _{n-1}$⁠. Therefore the determinant of ⁠$J_{n}$⁠ is
    ${\begin{aligned}|J_{n}|&=(-1)^{(n-1)+n}(-rs_{1}\dotsm s_{n-2}s_{n-1})(s_{n-1}|J_{n-1}|)\\&\qquad+(-1)^{n+n}(rs_{1}\dotsm s_{n-2}c_{n-1})(c_{n-1}|J_{n-1}|)\\&=(rs_{1}\dotsm s_{n-2}|J_{n-1}|(s_{n-1}^{2}+c_{n-1}^{2})\\&=(rs_{1}\dotsm s_{n-2})|J_{n-1}|.\end{aligned}}$
Induction then gives a closed-form expression for the volume element in spherical coordinates
    ${\begin{aligned}d^{n}V&=\left|\det {\frac {\partial (x_{i})}{\partial \left(r,\varphi _{j}\right)}}\right|dr\,d\varphi _{1}\,d\varphi _{2}\cdots d\varphi _{n-1}\\&=r^{n-1}\sin ^{n-2}(\varphi _{1})\sin ^{n-3}(\varphi _{2})\cdots \sin(\varphi _{n-2})\,dr\,d\varphi _{1}\,d\varphi _{2}\cdots d\varphi _{n-1}.\end{aligned}}$
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
    $d_{S^{n-1}}V=R^{n-1}\sin ^{n-2}(\varphi _{1})\sin ^{n-3}(\varphi _{2})\cdots \sin(\varphi _{n-2})\,d\varphi _{1}\,d\varphi _{2}\cdots d\varphi _{n-1}.$
The natural choice of an orthogonal basis over the angular coordinates is a product of ultraspherical polynomials,
    ${\begin{aligned}&\quad \int _{0}^{\pi }\sin ^{n-j-1}\left(\varphi _{j}\right)C_{s}^{\left({\frac {n-j-1}{2}}\right)}\cos \left(\varphi _{j}\right)C_{s'}^{\left({\frac {n-j-1}{2}}\right)}\cos \left(\varphi _{j}\right)\,d\varphi _{j}\\[6pt]&={\frac {2^{3-n+j}\pi \Gamma (s+n-j-1)}{s!(2s+n-j-1)\Gamma ^{2}\left({\frac {n-j-1}{2}}\right)}}\delta _{s,s'}\end{aligned}}$
for ⁠$j=1,2,\ldots ,n-2$⁠, and the ⁠$e^{is\varphi _{j}}$⁠ for the angle ⁠$j=n-1$⁠ in concordance with the spherical harmonics.

### Polyspherical coordinates

The standard spherical coordinate system arises from writing ⁠$\mathbb {R} ^{n}$⁠ as the product ⁠$\mathbb {R} \times \mathbb {R} ^{n-1}$⁠. These two factors may be related using polar coordinates. For each point ⁠$\mathbf {x}$⁠ of $\mathbb {R} ^{n}$, the standard Cartesian coordinates
    $\mathbf {x} =(x_{1},\dots ,x_{n})=(y_{1},z_{1},\dots ,z_{n-1})=(y_{1},\mathbf {z} )$
can be transformed into a mixed polar–Cartesian coordinate system:
    $\mathbf {x} =(r\sin \theta ,(r\cos \theta ){\hat {\mathbf {z} }}).$
This says that points in ⁠$\mathbb {R} ^{n}$⁠ may be expressed by taking the ray starting at the origin and passing through ${\hat {\mathbf {z} }}=\mathbf {z} /\lVert \mathbf {z} \rVert \in S^{n-2}$, rotating it towards $(1,0,\dots ,0)$ by $\theta =\arcsin y_{1}/r$, and traveling a distance $r=\lVert \mathbf {x} \rVert$ along the ray. Repeating this decomposition eventually leads to the standard spherical coordinate system.
Polyspherical coordinate systems arise from a generalization of this construction. The space ⁠$\mathbb {R} ^{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 ⁠$\mathbb {R} ^{n}=\mathbb {R} ^{p}\times \mathbb {R} ^{q}$⁠. Using this decomposition, a point ⁠$x\in \mathbb {R} ^{n}$⁠ may be written as
    $\mathbf {x} =(x_{1},\dots ,x_{n})=(y_{1},\dots ,y_{p},z_{1},\dots ,z_{q})=(\mathbf {y} ,\mathbf {z} ).$
This can be transformed into a mixed polar–Cartesian coordinate system by writing:
    $\mathbf {x} =((r\sin \theta ){\hat {\mathbf {y} }},(r\cos \theta ){\hat {\mathbf {z} }}).$
Here ${\hat {\mathbf {y} }}$ and ${\hat {\mathbf {z} }}$ are the unit vectors associated to ⁠$\mathbf {y}$⁠ and ⁠$\mathbf {z}$⁠. This expresses ⁠$\mathbf {x}$⁠ in terms of ⁠${\hat {\mathbf {y} }}\in S^{p-1}$⁠, ⁠${\hat {\mathbf {z} }}\in S^{q-1}$⁠, ⁠$r\geq 0$⁠, and an angle ⁠$\theta$⁠. It can be shown that the domain of ⁠$\theta$⁠ is ⁠$[0,2\pi )$⁠ if ⁠$p=q=1$⁠, ⁠$[0,\pi ]$⁠ if exactly one of ⁠$p$⁠ and ⁠$q$⁠ is ⁠$1$⁠, and ⁠$[0,\pi /2]$⁠ if neither ⁠$p$⁠ nor ⁠$q$⁠ are ⁠$1$⁠. The inverse transformation is
    ${\begin{aligned}r&=\lVert \mathbf {x} \rVert ,\\\theta &=\arcsin {\frac {\lVert \mathbf {y} \rVert }{\lVert \mathbf {x} \rVert }}=\arccos {\frac {\lVert \mathbf {z} \rVert }{\lVert \mathbf {x} \rVert }}=\arctan {\frac {\lVert \mathbf {y} \rVert }{\lVert \mathbf {z} \rVert }}.\end{aligned}}$
These splittings may be repeated as long as one of the factors involved has dimension two or greater. A polyspherical coordinate system is the result of repeating these splittings until there are no Cartesian coordinates left. Splittings after the first do not require a radial coordinate because the domains of ${\hat {\mathbf {y} }}$ and ${\hat {\mathbf {z} }}$ are spheres, so the coordinates of a polyspherical coordinate system are a non-negative radius and ⁠$n-1$⁠ angles. The possible polyspherical coordinate systems correspond to binary trees with ⁠$n$⁠ leaves. Each non-leaf node in the tree corresponds to a splitting and determines an angular coordinate. For instance, the root of the tree represents ⁠$\mathbb {R} ^{n}$⁠, and its immediate children represent the first splitting into ⁠$\mathbb {R} ^{p}$⁠ and ⁠$\mathbb {R} ^{q}$⁠. Leaf nodes correspond to Cartesian coordinates for ⁠$S^{n-1}$⁠. The formulas for converting from polyspherical coordinates to Cartesian coordinates may be determined by finding the paths from the root to the leaf nodes. These formulas are products with one factor for each branch taken by the path. For a node whose corresponding angular coordinate is ⁠$\theta _{i}$⁠, taking the left branch introduces a factor of ⁠$\sin \theta _{i}$⁠ and taking the right branch introduces a factor of ⁠$\cos \theta _{i}$⁠. The inverse transformation, from polyspherical coordinates to Cartesian coordinates, is determined by grouping nodes. Every pair of nodes having a common parent can be converted from a mixed polar–Cartesian coordinate system to a Cartesian coordinate system using the above formulas for a splitting.
Polyspherical coordinates also have an interpretation in terms of the special orthogonal group. A splitting ⁠$\mathbb {R} ^{n}=\mathbb {R} ^{p}\times \mathbb {R} ^{q}$⁠ determines a subgroup
    $\operatorname {SO} _{p}(\mathbb {R} )\times \operatorname {SO} _{q}(\mathbb {R} )\subseteq \operatorname {SO} _{n}(\mathbb {R} ).$
This is the subgroup that leaves each of the two factors $S^{p-1}\times S^{q-1}\subseteq S^{n-1}$ fixed. Choosing a set of coset representatives for the quotient is the same as choosing representative angles for this step of the polyspherical coordinate decomposition.
In polyspherical coordinates, the volume measure on ⁠$\mathbb {R} ^{n}$⁠ and the area measure on ⁠$S^{n-1}$⁠ are products. There is one factor for each angle, and the volume measure on ⁠$\mathbb {R} ^{n}$⁠ also has a factor for the radial coordinate. The area measure has the form:
    $dA_{n-1}=\prod _{i=1}^{n-1}F_{i}(\theta _{i})\,d\theta _{i},$
where the factors ⁠$F_{i}$⁠ are determined by the tree. Similarly, the volume measure is
    $dV_{n}=r^{n-1}\,dr\,\prod _{i=1}^{n-1}F_{i}(\theta _{i})\,d\theta _{i}.$
Suppose we have a node of the tree that corresponds to the decomposition ⁠$\mathbb {R} ^{n_{1}+n_{2}}=\mathbb {R} ^{n_{1}}\times \mathbb {R} ^{n_{2}}$⁠ and that has angular coordinate ⁠$\theta$⁠. 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
    $F(\theta )={\frac {d\theta }{2\pi }}.$
If ⁠$n_{1}>1$⁠ and ⁠$n_{2}=1$⁠, and if ⁠$\mathrm {B}$⁠ denotes the beta function, then
    $F(\theta )={\frac {\sin ^{n_{1}-1}\theta }{\mathrm {B} ({\frac {n_{1}}{2}},{\frac {1}{2}})}}\,d\theta .$
If ⁠$n_{1}=1$⁠ and ⁠$n_{2}>1$⁠, then
    $F(\theta )={\frac {\cos ^{n_{2}-1}\theta }{\mathrm {B} ({\frac {1}{2}},{\frac {n_{2}}{2}})}}\,d\theta .$
Finally, if both ⁠$n_{1}$⁠ and ⁠$n_{2}$⁠ are greater than one, then
    $F(\theta )={\frac {(\sin ^{n_{1}-1}\theta )(\cos ^{n_{2}-1}\theta )}{{\frac {1}{2}}\mathrm {B} ({\frac {n_{1}}{2}},{\frac {n_{2}}{2}})}}\,d\theta .$

## Stereographic projection

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 ⁠${\bigl{\tfrac {x}{1-z}},{\tfrac {y}{1-z}}{\bigr ]}$⁠ on the ⁠$xy$⁠-plane. In other words,
    $[x,y,z]\mapsto \left[{\frac {x}{1-z}},{\frac {y}{1-z}}\right].$
Likewise, the stereographic projection of an ⁠$n$⁠-sphere ⁠$S^{n}$⁠ of radius ⁠$1$⁠ will map to the ⁠$(n-1)$⁠-dimensional hyperplane ⁠$\mathbb {R} ^{n-1}$⁠ perpendicular to the ⁠$x_{n}$⁠-axis as
    $[x_{1},x_{2},\ldots ,x_{n}]\mapsto \left[{\frac {x_{1}}{1-x_{n}}},{\frac {x_{2}}{1-x_{n}}},\ldots ,{\frac {x_{n-1}}{1-x_{n}}}\right].$

## Probability distributions
### Uniformly at random on the (n − 1)-sphere

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), ⁠$\mathbf {x} =(x_{1},x_{2},\ldots ,x_{n})$⁠. Now calculate the "radius" of this point:
    $r={\sqrt {x_{1}^{2}+x_{2}^{2}+\cdots +x_{n}^{2}}}.$
The vector ⁠${\tfrac {1}{r}}\mathbf {x}$⁠ is uniformly distributed over the surface of the unit ⁠$n$⁠-ball.
An alternative given by Marsaglia is to uniformly randomly select a point ⁠$\mathbf {x} =(x_{1},x_{2},\ldots ,x_{n})$⁠ in the unit n-cube by sampling each ⁠$x_{i}$⁠ independently from the uniform distribution over ⁠$(-1,1)$⁠, computing ⁠$r$⁠ as above, and rejecting the point and resampling if ⁠$r\geq 1$⁠ (i.e., if the point is not in the ⁠$n$⁠-ball), and when a point in the ball is obtained scaling it up to the spherical surface by the factor ⁠${\tfrac {1}{r}}$⁠; then again ⁠${\tfrac {1}{r}}\mathbf {x}$⁠ is uniformly distributed over the surface of the unit ⁠$n$⁠-ball. This method becomes very inefficient for higher dimensions, as a vanishingly small fraction of the unit cube is contained in the sphere. In ten dimensions, less than 2% of the cube is filled by the sphere, so that typically more than 50 attempts will be needed. In seventy dimensions, less than $10^{-24}$ of the cube is filled, meaning typically a trillion quadrillion trials will be needed, far more than a computer could ever carry out.

### Uniformly at random within the 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 ⁠$\mathbf {x}$⁠ is a point selected uniformly at random from the unit ⁠$(n-1)$⁠-sphere, then ⁠$u^{1/n}\mathbf {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},\ldots ,x_{n+2})$⁠ is a point selected uniformly from the unit ⁠$(n+1)$⁠-sphere, then ⁠$(x_{1},x_{2},\ldots ,x_{n})$⁠ is uniformly distributed within the unit ⁠$n$⁠-ball (i.e., by simply discarding two coordinates).
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.

### Distribution of the first coordinate

Let ⁠$y=x_{1}^{2}$⁠ be the square of the first coordinate of a point sampled uniformly at random from the ⁠$(n-1)$⁠-sphere, then its probability density function, for $y\in [0,1]$, is
$\rho (y)={\frac {\Gamma {\bigl{\frac {n}{2}}{\bigr )}}{{\sqrt {\pi }}\;\Gamma {\bigl{\frac {n-1}{2}}{\bigr )}}}(1-y)^{(n-3)/2}y^{-1/2}.$
Let $z=y/N$ be the appropriately scaled version, then at the $N\to \infty$ limit, the probability density function of $z$ converges to $(2\pi ze^{z})^{-1/2}$. This is sometimes called the Porter–Thomas distribution.

## Specific spheres
### 0-sphere

    The pair of points ⁠$\{\pm R\}$⁠ with the discrete topology for some ⁠$R>0$⁠. The only sphere that is not path-connected. Parallelizable.

### 1-sphere

    Commonly called a circle. Has a nontrivial fundamental group. Abelian Lie group structure U(1); the circle group. Homeomorphic to the real projective line. Parallelizable

### 2-sphere

    Commonly simply called a sphere. For its complex structure, see Riemann sphere. Homeomorphic to the complex projective line

### 3-sphere

    Parallelizable, principal U(1)-bundle over the ⁠$2$⁠-sphere, Lie group structure Sp(1) = SU(2).

### 4-sphere

    Homeomorphic to the quaternionic projective line, ⁠$\mathbf {HP} ^{1}$⁠. ⁠$\operatorname {SO} (5)/\operatorname {SO} (4)$⁠.

### 5-sphere

    Principal U(1)-bundle over the complex projective space ⁠$\mathbf {CP} ^{2}$⁠. ⁠$\operatorname {SO} (6)/\operatorname {SO} (5)=\operatorname {SU} (3)/\operatorname {SU} (2)$⁠. It is undecidable whether a given ⁠$n$⁠-dimensional manifold is homeomorphic to ⁠$S^{n}$⁠ for ⁠$n\geq 5$⁠.

### 6-sphere

    Possesses an almost complex structure coming from the set of pure unit octonions. ⁠$\operatorname {SO} (7)/\operatorname {SO} (6)=G_{2}/\operatorname {SU} (3)$⁠. The question of whether it has a complex structure is known as the Hopf problem, after Heinz Hopf.

### 7-sphere

    Topological quasigroup structure as the set of unit octonions. Principal ⁠$\operatorname {Sp} (1)$⁠-bundle over ⁠$S^{4}$⁠. Parallelizable. ⁠$\operatorname {SO} (8)/\operatorname {SO} (7)=\operatorname {SU} (4)/\operatorname {SU} (3)=\operatorname {Sp} (2)/\operatorname {Sp} (1)=\operatorname {Spin} (7)/G_{2}=\operatorname {Spin} (6)/\operatorname {SU} (3)$⁠. The ⁠$7$⁠-sphere is of particular interest since it was in this dimension that the first exotic spheres were discovered.

### 8-sphere

    Homeomorphic to the octonionic projective line ⁠$\mathbf {OP} ^{1}$⁠.

### 23-sphere

    A highly dense sphere-packing is possible in ⁠$24$⁠-dimensional space, which is related to the unique qualities of the Leech lattice.

## Octahedral sphere

The octahedral ⁠$n$⁠-sphere is defined similarly to the ⁠$n$⁠-sphere but using the 1-norm
    $S^{n}=\left\{x\in \mathbb {R} ^{n+1}:\left\|x\right\|_{1}=1\right\}$
In general, it takes the shape of a cross-polytope.
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. 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.