The diameter of a subset AA of a metric space (X,d)(X,d) is

diam⁡(A)=sup⁡{d(x,y):x∈A, y∈A}∈[0,∞],\operatorname{diam}(A)=\sup\{d(x,y): x\in A,\ y\in A\}\in[0,\infty],

where sup⁡\sup denotes the (and the value may be +∞+\infty). By convention, diam⁡(∅)=0\operatorname{diam}(\varnothing)=0.

Remarks

Diameter measures the “size” of a set in a way that is tailored to the ; it is directly tied to the notion of a .

Examples
  • In (R,∣⋅∣)(\mathbb{R},|\cdot|), diam⁡([a,b])=b−a\operatorname{diam}([a,b])=b-a for a≤ba\le b.
  • In R2\mathbb{R}^2 with the Euclidean metric, the unit circle has diameter 22.