# Equations Describing the Surface of an N-dimensional Hypersphere

###### Abstract.

We introduce the concept of an N-dimensional space and define a surface as a subset of points in that space that divides the space into two parts. We generalize the parametric equations of a circle in two dimensions and a sphere in three dimensions to those of the surface of an N-dimensional hypersphere. Finally, we unparameterize the equations, reducing them to a single multivariable equation of the form $F({x}_{1},{x}_{2},\mathrm{\dots},{x}_{N})$, and show that $F>0$ corresponds to the region outside of the hypersphere, $F<0$ corresponds to the interior of the hypersphere, and $F=0$ corresponds to the surface of the hypersphere.

^{†}

^{†}copyright: ©2021 Daniel F. Savarese

## 1. N-dimensional Spaces

Coordinates are variables grouped together for analytical purposes. We most often relate coordinates to two- or three-dimensional physical spaces, such as when noting the locations of chess pieces on a chess board or using GPS (Global Positioning System) coordinates to navigate aircraft. But coordinates need not represent physical locations. Any function of one or more variables may be plotted as a set of points in a coordinate system. Nor must coordinates be limited to two or three dimensions. If we were to track the position of an object in three-dimensional space through time, we would require four coordinates: $({x}_{1},{x}_{2},{x}_{3},t)$, where the first three coordinates identify the position in space and $t$ the position in time.

Visualizing a function in two or three dimensions helps us analyze its properties. Although it may not be possible to do the same in higher dimensions, we can project higher-dimensional artifacts onto a lower-dimensional space to help our visually-oriented brains reason about them. Alternatively, we can reason about a higher-dimensional artifact by analyzing its lower-dimensional analogues. For example, a square has a surface (i.e., its perimeter) formed by line segments equal in length and corners formed by the meeting of two line segments at right angles. A cube has a surface formed by squares equal in area and corners formed by three line segments meeting at right angles to each other. A four-dimensional hypercube has a surface formed by cubes equal in volume and corners formed by four line segments meeting at right angles to each other.

To fully generalize the analysis of multivariable systems, we do not
restrict ourselves to a specific number of dimensions. Instead, we
work with an unspecified positive integral number of dimensions,
denoted by $N$. We notate the variables of the system as a set of
coordinates, $({x}_{1},{x}_{2},\mathrm{\dots},{x}_{N})$. A particular set of values for
the coordinate variables is a *point* and the universe of
possible points in the system comprises an *N-dimensional space*.
The range of coordinate values may be finite or infinite. In either
case, we represent a space with ${V}_{N}$.^{1}^{1}1We could choose any
letter, but $V$ works as a mnemonic for either *vector*—as in
*vector space*—or *volume*—as in if a surface ${V}_{N-1}$ is
an analogue of area, then a space ${V}_{N}$ is an analogue of volume.

## 2. A Degenerate Case: The Circle

Before describing the surface of an $N$-dimensional hypersphere, we
will examine the degenerate case of the surface of a two-dimensional
sphere, commonly known as a circle. The surface of a circle is the
set of all points a constant distance—called the *radius*—from
a central point. The circle itself is comprised of the surface and
all the points inside the surface. Therefore, the surface divides
space into two regions: points inside of the surface and points
outside of the surface. You may notice we made no reference to the
number of dimensions. It so happens that the definition applies to
any hypersphere of two or more dimensions. For the circle, we will
work with only two dimensions.

Looking at Figure 1, another way to think of a circle is that it traces out every possible right triangle with a hypotenuse equal to the length of the radius. The hypotenuse of each triangle extends from the center of the circle to a point $({x}_{1},{x}_{2})$ on the circle’s circumference, forming an angle $\theta $ with the ${x}_{1}$ axis. From the trigonometric definitions of sine and cosine and a visual analysis of the figure, we can see the following relationships:

$$\mathrm{cos}\theta =\frac{{x}_{1}}{r}\mathit{\hspace{1em}}\text{and}\mathit{\hspace{1em}}\mathrm{sin}\theta =\frac{{x}_{2}}{r}.$$ |

Solving for the coordinates in terms of the angle yields the parametric equations of a circle,

$${x}_{1}=r\mathrm{cos}\theta \mathit{\hspace{1em}}\text{and}\mathit{\hspace{1em}}{x}_{2}=r\mathrm{sin}\theta .$$ | (1) |

We can use the Pythagorean theorem to arrive at the algebraic equation of a circle directly,

$${x}_{1}^{2}+{x}_{2}^{2}={r}^{2}.$$ | (2) |

But let us derive it from the parametric equations so that we can benefit from the approach later. Recognizing that $si{n}^{2}\theta +co{s}^{2}\theta =1$—an identity resulting from the Pythagorean thereom—we simplify as follows:

$$\begin{array}{cc}\hfill {x}_{1}^{2}+{x}_{2}^{2}=& {r}^{2}{\mathrm{cos}}^{2}\theta +{r}^{2}{\mathrm{sin}}^{2}\theta ;\hfill \\ \hfill =& {r}^{2}({\mathrm{cos}}^{2}\theta +{\mathrm{sin}}^{2}\theta );\hfill \\ \hfill =& {r}^{2}.\hfill \end{array}$$ |

Although Equations 1 and 2 should be obvious to a middle- or high-school student who has taken a course in analytic geometry, we reviewed them to make clear their relationship to the equations of a fully generalized N-dimensional hypersphere in Section 4.

Before moving on, observe that for all points inside the circle, ${x}_{1}^{2}+{x}_{2}^{2}<{r}^{2}$ must be true; and for all points outside the circle, ${x}_{1}^{2}+{x}_{2}^{2}>{r}^{2}$ must be true. If we rewrite Equation 2 as

$${x}_{1}^{2}+{x}_{2}^{2}-{r}^{2}=0,$$ | (3) |

we can re-express the division of space in terms of the values taken on by the resulting function,

$$F({x}_{1},{x}_{2})={x}_{1}^{2}+{x}_{2}^{2}-{r}^{2}\{\begin{array}{cc}\hfill <0& \text{is inside of the circle;}\hfill \\ \hfill =0& \text{is on the surface of the circle;}\hfill \\ \hfill >0& \text{is outside of the circle.}\hfill \end{array}$$ | (4) |

It should be clear that for a point to lie inside of the circle, the distance from the center of the circle to the point, $\sqrt{{x}_{1}^{2}+{x}_{2}^{2}}$, must be less than the radius of the circle. Likewise, the distance must be greater than the radius for the point to lie outside of the circle. The distance is equal to the radius for points lying on the surface of the circle.

## 3. A Special Case: The Sphere

Having analyzed the equations of a circle, we can make a similar
geometric analysis to arrive at the equations for the surface of a
sphere. Whereas a point on a circle can be located with two
parameters—a radius $r$ and an angle $\theta $—a point on a sphere
requires three parameters—a radius $r$ and two angles, ${\theta}_{1}$ and
${\theta}_{2}$. The coordinate system of a circle is known as a
*polar* coordinate system and the coordinate system of a sphere is
known as a *spherical* coordinate system. We will parameterize
the Cartesian coordinates of a point on a sphere in terms of spherical
coordinates before rewriting them as a single algebraic function.

Figure 2 shows the spherical and Cartesian coordinates of a point $P$ on a sphere. By combining visual inspection with geometric and trigonometric identities, we can express $({x}_{1},{x}_{2},{x}_{3})$ in terms of $(r,{\theta}_{1},{\theta}_{2})$. First, we look at the right triangle formed by the origin, the point $P$, and the projection of $P$ onto the ${x}_{2}{x}_{3}$ plane. The spherical radius $r$ forms the hypotenuse of the triangle and ${x}_{1}$ is its height. The angle formed at point $P$ is equal to ${\theta}_{1}$, being the alternate interior angle formed by the ${x}_{1}$ axis and the side of the triangle parallel to it. Thereby we arrive at our first equation,

$$\mathrm{cos}{\theta}_{1}=\frac{{x}_{1}}{r},\text{which implies}\mathit{\hspace{1em}}{x}_{1}=r\mathrm{cos}{\theta}_{1}.$$ |

The base of the triangle must then have a length equal to $r\mathrm{sin}{\theta}_{1}$. This forms the hypotenuse of the right triangle in the ${x}_{2}{x}_{3}$ plane, allowing us to write

$$\mathrm{cos}{\theta}_{2}=\frac{{x}_{2}}{r\mathrm{sin}{\theta}_{1}},\text{which implies}\mathit{\hspace{1em}}{x}_{2}=r\mathrm{sin}{\theta}_{1}\mathrm{cos}{\theta}_{2}.$$ |

Finally, the side opposite ${\theta}_{2}$ is equal to ${x}_{3}$, giving us

$$\mathrm{sin}{\theta}_{2}=\frac{{x}_{3}}{r\mathrm{sin}{\theta}_{1}},\text{which implies}\mathit{\hspace{1em}}{x}_{3}=r\mathrm{sin}{\theta}_{1}\mathrm{sin}{\theta}_{2}.$$ |

We now have the parametric equations of a sphere,

$$\begin{array}{cc}\hfill {x}_{1}=& r\mathrm{cos}{\theta}_{1};\hfill \\ \hfill {x}_{2}=& r\mathrm{sin}{\theta}_{1}\mathrm{cos}{\theta}_{2};\hfill \\ \hfill {x}_{3}=& r\mathrm{sin}{\theta}_{1}\mathrm{sin}{\theta}_{2}.\hfill \end{array}$$ | (5) |

As with the circle, we can either use the Pythagorean theorem directly to express the distance between two points—the origin and $P$—in three dimensions, or we can derive an expression from the parametric equations. Using the approach we used to arrive at Equation 3, we can eliminate the angles as follows:

$$\begin{array}{cc}\hfill {x}_{1}^{2}+{x}_{2}^{2}+{x}_{3}^{2}=& {r}^{2}{\mathrm{cos}}^{2}{\theta}_{1}+{r}^{2}{\mathrm{sin}}^{2}{\theta}_{1}{\mathrm{cos}}^{2}{\theta}_{2}+{r}^{2}{\mathrm{sin}}^{2}{\theta}_{1}{\mathrm{sin}}^{2}{\theta}_{2};\hfill \\ \hfill =& {r}^{2}({\mathrm{cos}}^{2}{\theta}_{1}+{\mathrm{sin}}^{2}{\theta}_{1}{\mathrm{cos}}^{2}{\theta}_{2}+{\mathrm{sin}}^{2}{\theta}_{1}{\mathrm{sin}}^{2}{\theta}_{2});\hfill \\ \hfill =& {r}^{2}({\mathrm{cos}}^{2}{\theta}_{1}+{\mathrm{sin}}^{2}{\theta}_{1}({\mathrm{cos}}^{2}{\theta}_{2}+si{n}^{2}{\theta}_{2}));\hfill \\ \hfill =& {r}^{2}({\mathrm{cos}}^{2}{\theta}_{1}+{\mathrm{sin}}^{2}{\theta}_{1}\cdot 1);\hfill \\ \hfill =& {r}^{2}.\hfill \end{array}$$ |

This allows us to write the spherical equivalent of Equation 4 as

$$F({x}_{1},{x}_{2},{x}_{3})={x}_{1}^{2}+{x}_{2}^{2}+{x}_{3}^{2}-{r}^{2}\{\begin{array}{cc}\hfill <0& \text{is inside of the sphere;}\hfill \\ \hfill =0& \text{is on surface of the sphere;}\hfill \\ \hfill >0& \text{is outside of the sphere.}\hfill \end{array}$$ | (6) |

## 4. The General Case: An N-dimensional Hypersphere

Based on the circle and the sphere, we can infer that a point on the surface of an N-dimensional hypersphere can be located with a radius $r$ and $N-1$ angles, written as $(r,{\theta}_{1},{\theta}_{2},\mathrm{\dots},{\theta}_{N-1})$. Alternatively, one can use $N$ coordinates corresponding to the position along $N$ mutually perpendicular axes, written as $({x}_{1},{x}_{2},\mathrm{\dots},{x}_{N})$. The angles and perpendicular axes create the same trigonometric relationships as in the lower-dimensional cases. For example, a four-dimensional hypersphere’s coordinates can be written as $(r,{\theta}_{1},{\theta}_{2},{\theta}_{3})$ or $({x}_{1},{x}_{2},{x}_{3},{x}_{4})$, producing the following equations:

$$\begin{array}{cc}\hfill {x}_{1}=& r\mathrm{cos}{\theta}_{1};\hfill \\ \hfill {x}_{2}=& r\mathrm{sin}{\theta}_{1}\mathrm{cos}{\theta}_{2};\hfill \\ \hfill {x}_{3}=& r\mathrm{sin}{\theta}_{1}\mathrm{sin}{\theta}_{2}\mathrm{cos}{\theta}_{3};\hfill \\ \hfill {x}_{4}=& r\mathrm{sin}{\theta}_{1}\mathrm{sin}{\theta}_{2}\mathrm{sin}{\theta}_{3}.\hfill \end{array}$$ | (7) |

These can be generalized to N dimensions as follows:

$$\begin{array}{cc}\hfill {x}_{1}=& r\mathrm{cos}{\theta}_{1};\hfill \\ \hfill {x}_{2}=& r\mathrm{sin}{\theta}_{1}\mathrm{cos}{\theta}_{2};\hfill \\ \hfill {x}_{3}=& r\mathrm{sin}{\theta}_{1}\mathrm{sin}{\theta}_{2}\mathrm{cos}{\theta}_{3};\hfill \\ \hfill \mathrm{\cdots}=& \mathrm{\cdots};\hfill \\ \hfill {x}_{N-1}=& r\mathrm{sin}{\theta}_{1}\mathrm{sin}{\theta}_{2}\mathrm{cos}{\theta}_{3}\mathrm{\dots}\mathrm{sin}{\theta}_{N-2}\mathrm{cos}{\theta}_{N-1};\hfill \\ \hfill {x}_{N}=& r\mathrm{sin}{\theta}_{1}\mathrm{sin}{\theta}_{2}\mathrm{cos}{\theta}_{3}\mathrm{\dots}\mathrm{sin}{\theta}_{N-2}\mathrm{sin}{\theta}_{N-1}.\hfill \end{array}$$ | (8) |

Using the same technique we used to arrive at Equations 4 and 6, we eliminate the angles, producing

${x}_{1}^{2}+{x}_{2}^{2}+{x}_{3}^{2}+\mathrm{\cdots}+{x}_{N-1}^{2}+{x}_{N}^{2}$ | $={r}^{2}({\mathrm{cos}}^{2}{\theta}_{1}+{\mathrm{sin}}^{2}{\theta}_{1}({\mathrm{cos}}^{2}{\theta}_{2}+$ | ||

${\mathrm{sin}}^{2}{\theta}_{2}({\mathrm{cos}}^{2}{\theta}_{3}+{\mathrm{sin}}^{2}{\theta}_{3}(\mathrm{\dots}$ | |||

$({\mathrm{cos}}^{2}{\theta}_{N-2}+{\mathrm{sin}}^{2}{\theta}_{N-2}({\mathrm{cos}}^{2}{\theta}_{N-1}+$ | |||

${\mathrm{sin}}^{2}{\theta}_{N-1}))))));$ | |||

${x}_{1}^{2}+{x}_{2}^{2}+{x}_{3}^{2}+\mathrm{\cdots}+{x}_{N-1}^{2}+{x}_{N}^{2}$ | $={r}^{2}.$ |

We can now write the general equation for the surface of an N-dimensional hypersphere as

$$F({x}_{1},{x}_{2},\mathrm{\dots},{x}_{N})=\sum _{i=1}^{N}{x}_{i}^{2}-{r}^{2}\{\begin{array}{cc}\hfill <0& \text{is inside of the}\hfill \\ & \text{hypersphere;}\hfill \\ \hfill =0& \text{is on the surface of the}\hfill \\ & \text{hypersphere;}\hfill \\ \hfill >0& \text{is outside of the}\hfill \\ & \text{hypersphere.}\hfill \end{array}$$ | (9) |

Throughout this presentation we have assumed the origin of the coordinate system is the center of the hypersphere. In order to account for the center being located at an arbitrary point $({x}_{{1}_{0}},{x}_{{2}_{0}},\mathrm{\dots},{x}_{{N}_{0}})$, we can further generalize the equation for the surface of a hypersphere as

$$F({x}_{1},{x}_{2},\mathrm{\dots},{x}_{N})=\sum _{i=1}^{N}{({x}_{i}-{x}_{{i}_{0}})}^{2}-{r}^{2}=0.$$ | (10) |