---
tag: JSQ840425F
kind: definition
name: Sphere
msc: [51M05, 51M04]
defines: P9CM4GQ2T0
uses: [0XPR1E85W0, 0NPPGHQNXQ]
sources:
  - url: https://en.wikipedia.org/wiki/Sphere
---

## Definition

Let $n \ge 1$ and let $d$ be the [[Euclidean distance|0NPPGHQNXQ]] on the [[Euclidean space|0XPR1E85W0]] $\R^n$.
Let $c \in \R^n$ be a point and let $r > 0$ be a real number.
The *sphere* with centre $c$ and radius $r$ is the set
$$S(c, r) = \set{x \in \R^n : d(x, c) = r}.$$

## Remarks

In coordinates, $S(c, r)$ is the set of solutions of $(x_1 - c_1)^2 + \cdots + (x_n - c_n)^2 = r^2$.
The ordinary sphere is the case $n = 3$, and the case $n = 2$ is a [[circle|060W5CBZP6]].
The unit sphere $S(0, 1)$ in $\R^{n+1}$ is the [[n-sphere|T62369RFH6]] $S^n$.
In any [[metric space|0VKD1TP7F3]] $(X, d)$, the same formula defines the sphere $S(c, r)$; Mathlib's `EuclideanGeometry.Sphere` records a centre and a radius in this way.

Example: the set $x^2 + y^2 + z^2 - 2x = 0$ in $\R^3$ is $S((1, 0, 0), 1)$.
Indeed, the equation is $(x - 1)^2 + y^2 + z^2 = 1$.

Non-example: for $r = 0$ the set $\set{x : d(x, c) = 0}$ is the single point $c$.
It fails the condition $r > 0$, so it is not a sphere.
