represents a unit sphere centered at the point p.


represents a sphere of radius r centered at the point p.


represents a collection of spheres of radius r.


  • Sphere can be used as a geometric region and a graphics primitive.
  • Sphere[] is equivalent to Sphere[{0,0,0}]. »
  • Sphere[n] for positive integer n is equivalent to Sphere[{0,,0}], a unit sphere in .
  • Sphere represents the shell {x|TemplateBox[{{x, -, p}}, Norm]=r}.
  • Sphere can be used in Graphics and Graphics3D.
  • In graphics, the points p, pi and radii r can be Scaled and Dynamic expressions.
  • Graphics rendering is affected by directives such as FaceForm, Specularity, Opacity, and color.
  • Sphere[{p1,p2,},{r1,r2,}] represents a collection of spheres with centers pi and radii ri.

Background & Context

  • Sphere is a graphics and geometry primitive that represents a sphere in -dimensional space. In particular, Sphere[p,r] represents the sphere {x:TemplateBox[{{x, -, p}}, Norm]=r} in TemplateBox[{}, Reals]^n with center p and radius r, where r may be any non-negative real number and p can have any positive length . The shorthand form Sphere[p] is equivalent to Sphere[p,1] and Sphere[n] is equivalent to Sphere[ConstantArray[0, n],1], while Sphere[] autoevaluates to Sphere[{0,0,0}].
  • Collections of sphere objects (multi-spheres) of common radius may be efficiently represented using Sphere[{p1,,pk},r] and balls of varying radii represented using Sphere[{p1,,pk},{r1,,rk}].
  • Sphere objects can be visually formatted in two and three dimensions using Graphics and Graphics3D, respectively. The appearance of Sphere objects in graphics can be modified by specifying the face directive FaceForm (in 3D); color directives such as Red; the transparency and specularity directives Opacity and Specularity; and the style option Antialiasing.
  • Sphere may also serve as a region specification over which a computation should be performed. For example, Integrate[1,{x,y,z}Sphere[{0,0,0},r]] and Area[Sphere[{0,0,0},r]] both return the surface area of a sphere of radius .
  • Sphere is related to a number of other symbols. Sphere represents the boundary of a ball, as can be computed using RegionBoundary[Ball[{x,y,z},r]]. Ellipsoidal surfaces (not to be confused with the solid ellipsoids represented by Ellipsoid) may be obtained from a Sphere using Scaled. A sphere passing through a set of given points may be obtained using Circumsphere. Sphere objects may be represented as ImplicitRegion[(x-u)2+(y-v)2+(z-w)2r2,{u,v,w}] or ParametricRegion[{x,y,z}+r{Cos[θ]Sin[ϕ],Sin[θ]Sin[ϕ],Cos[ϕ]},{{θ,0,2π},{ϕ,0,π}}]. Precomputed properties of the sphere in standard position are available using SurfaceData["Sphere",property] or Entity["Surface","Sphere"][property].


open all close all

Basic Examples  (2)

A unit sphere at the origin:

Click for copyable input

Area and centroid:

Click for copyable input
Click for copyable input

Scope  (22)

Applications  (5)

Properties & Relations  (8)

Neat Examples  (4)

Introduced in 2007
Updated in 2014