Insphere
Details
- Insphere is also known as incircle, inscribed circle, or inscribed disk.
- Insphere gives the Sphere of largest measure (arc length, area, etc.) that can be inscribed in the simplex (triangle, tetrahedron, etc.) defined by points pi.
- Insphere evaluates to a Sphere[c,r], where the center c is known as the incenter and radius r is known as the inradius for the related simplex.
- Insphere is defined for
and affinely independent. - For polyhedra, Insphere[poly] returns a sphere that is contained within the polyhedron poly and tangent to each of the polyhedron faces.
- For polygons, Insphere[poly] returns a sphere that is contained within the polygon poly and tangent to each of the polygon edges.
- Insphere can be used with symbolic points in GeometricScene.
Examples
open all close allBasic Examples (2)
Graphics[Insphere[{{0, 0}, {1, 0}, {0, 1}}]]Graphics3D[Insphere[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}]]The insphere of the regular octahedron:
ℛ = Insphere[Octahedron[]]Graphics3D[{Opacity[0.5], Octahedron[], Red, ℛ}]Area[ℛ]Scope (17)
Graphics (6)
Specification (2)
Inspheres in different dimensions:
Graphics[Insphere[{{0, 0}, {1, 0}, {0, 1}}]]Graphics3D[Insphere[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}]]Insphere evaluates to a Sphere:
Insphere[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}]{First@%, Last@%}Styling (4)
ℛ = Insphere[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];Table[Graphics3D[{c, ℛ}], {c, {Red, Green, Blue, Yellow}}]Different properties can be specified for the front and back of faces using FaceForm:
ℛ = Insphere[{{-1, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];Graphics3D[{FaceForm[Yellow, Blue], ℛ}, PlotRange -> {{-0.2, 0.2}, {0.05, 0.5}, {0.05, 0.5}}]Inspheres with different specular exponents:
ℛ = Insphere[{{-1, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];Table[Graphics3D[{Orange, Specularity[White, n], ℛ}], {n, {5, 20, 100}}]Black circumsphere that glows red:
Graphics3D[{Glow[Red], Black, ℛ}]Opacity specifies the face opacity:
ℛ = Insphere[{{-1, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];Table[Graphics3D[{Opacity[o], ℛ}], {o, {0.3, 0.5, 0.9}}]Regions (11)
Insphere works in any number of dimensions:
Insphere[{{0, 0, 0, 0, 0}, {1, 0, 0, 0, 0}, {0, 1, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 0, 0, 1}}]Get the circumcenter and circumradius:
{First[%], Last[%]}Embedding dimension is the dimension of the space in which the sphere lives:
ℛ = Insphere[{{0, 0}, {1, 0}, {1, 1}}];RegionEmbeddingDimension[ℛ]Geometric dimension is the dimension of the shape itself:
RegionDimension[ℛ]ℛ = Insphere[(2 + Sqrt[3]){{1, 0, 0}, {0, 1, 0}, {0, 0, 1}, {-1, 0, 0}}];{RegionMember[ℛ, {1, 1, 1}], RegionMember[ℛ, {1, 2, 3}]}Get conditions for membership:
RegionMember[ℛ, {x, y, z}]ℛ = Insphere[{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}, {-1, 0, 0}}];{Area[ℛ], RegionMeasure[ℛ]}c = RegionCentroid[ℛ]Graphics3D[{{Opacity[0.5], LightBlue, ℛ}, {PointSize[Large], Red, Point[c]}}]ℛ = Insphere[{{1 + Sqrt[2], -1}, {0, Sqrt[2]}, {-1 - Sqrt[2], -1}}];RegionDistance[ℛ, {1, 2}]{Plot3D[RegionDistance[ℛ, {x, y}], {x, -2, 2}, {y, -2, 2}, MeshFunctions -> {#3&}, Mesh -> 5, Exclusions -> Norm[{x, y}] == 1], ContourPlot[RegionDistance[ℛ, {x, y}], {x, -2, 2}, {y, -2, 2}, Contours -> {{0.5, Red}, {1, Green}, {1.5, Blue}}]}ℛ = Insphere[{{1 + Sqrt[2], -1}, {0, Sqrt[2]}, {-1 - Sqrt[2], -1}}];{SignedRegionDistance[ℛ, {2, 0}], SignedRegionDistance[ℛ, {1 / 4, 1 / 3}]}Plot3D[SignedRegionDistance[ℛ, {x, y}], {x, -2, 2}, {y, -2, 2}, MeshFunctions -> {#3&}, Mesh -> 5, Exclusions -> Norm[{x, y}] == 1]ℛ = Insphere[Sqrt[3] (1 + Sqrt[3]){{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}]{RegionNearest[ℛ, {2, 2, 2}], RegionNearest[ℛ, {(1/2), (1/2), (1/2)}]}Nearest points to an enclosing sphere:
spherePoints[{n_, m_}, c_, r_] :=
Flatten[Table[c + r{Cos[k 2π / n]Sin[l π / m], Sin[k 2π / n]Sin[l π / m], Cos[l π / m]}, {k, 0., n - 1}, {l, 0., m - 1}], 1];pl = spherePoints[{8, 8}, RegionCentroid[ℛ], 3 / 2];
npl = Table[RegionNearest[ℛ, p], {p, pl}];Legended[Graphics3D[{ℛ, {Thin, Gray, Line[Transpose[{pl, npl}]]}, {Red, Point[pl]}, {PointSize[Medium], Blue, Point[npl]}}, Lighting -> "Neutral", Boxed -> False], PointLegend[{Red, Blue}, {"start", "nearest"}]]ℛ = Insphere[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];BoundedRegionQ[ℛ]r = RegionBounds[ℛ]Graphics3D[{{EdgeForm[White], Opacity[0.2, Yellow], Cuboid@@Transpose[r]}, ℛ}, Boxed -> False]ℛ = Insphere[{{-1, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];Integrate[1, {x, y, z}∈ℛ]Integrate[x^2y^2z^2, {x, y, z}∈ℛ]ℛ = Insphere[{{-1, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];Maximize[{x^2 + y^2 + z^2, {x, y, z}∈ℛ}, {x, y, z}]Solve equations over an Insphere:
ℛ = Insphere[{{-1, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];Reduce[x^2 == y^2 == z^2 && {x, y, z}∈ℛ, {x, y, z}]//FullSimplifyApplications (3)
Recursively construct inscribed triangles and disks:
intriangle[pts_] := Block[{center = First@Insphere[pts]}, RegionNearest[Line[#], center]& /@ Subsets[pts, {2}]]initial = {{0, 0}, {0, 2}, {2., 0}};tpts = NestList[intriangle, initial, 3];Table[{Gray, Triangle[p], LightOrange, Disk@@Insphere[p]}, {p, tpts}]//GraphicsUse Insphere to generate a circle packing for a triangulated region. First triangulate the region:
ℛ = TriangulateMesh@DiscretizeGraphics[CountryData["UnitedStates", {"Polygon", "Mercator"}]]Use Insphere to compute a circle for each triangle:
circles = Insphere[First[#]]& /@ MeshPrimitives[ℛ, 2];Graphics[{Opacity[0.5], Map[{RandomColor[], #}&, circles]}]packingArea = Total@Map[Area[Disk@@#]&, circles]regionArea = Area[ℛ]packingArea / regionAreaUse Insphere to generate a sphere packing for a triangulated region. First discretize and triangulate the region:
ℛ = TriangulateMesh[[image], MeshQualityGoal -> "Minimal"]Use Insphere to compute spheres for each tetrahedron:
spheres = Insphere[First[#]]& /@ MeshPrimitives[ℛ, 3];Graphics3D[{Opacity[0.5], Map[{RandomColor[], #}&, spheres]}]packingVolume = Total@Map[Volume[Ball@@#]&, spheres]regionVolume = Volume[ℛ]packingVolume / regionVolumeProperties & Relations (2)
Insphere is the largest Sphere that can be inscribed in a Simplex:
pts = {{0, 0}, {1, 0}, {0, 1}};Graphics[{Simplex[pts], Red, Insphere[pts]}]pts = {{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}};Graphics3D[{Opacity[0.5], Simplex[pts], Red, Insphere[pts]}]Use Circumsphere to get a Sphere (blue) that circumscribes a Simplex:
pts = {{0, 0}, {1, 0}, {0, 1}};Graphics[{Simplex[pts], Blue, Circumsphere[pts], Red, Insphere[pts]}]pts = {{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}};Graphics3D[{Opacity[0.2], Simplex[pts], Blue, Circumsphere[pts], Red, Insphere[pts]}, Boxed -> False]See Also
Circumsphere Sphere Ball Triangle Polygon Tetrahedron Polyhedron Simplex GeometricScene
Function Repository: Incircle3D BrocardInellipse LemoineInellipse NestedIncirclePolygons
Related Guides
Text
Wolfram Research (2015), Insphere, Wolfram Language function, https://reference.wolfram.com/language/ref/Insphere.html (updated 2019).
CMS
Wolfram Language. 2015. "Insphere." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/Insphere.html.
APA
Wolfram Language. (2015). Insphere. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Insphere.html
BibTeX
@misc{reference.wolfram_2026_insphere, author="Wolfram Research", title="{Insphere}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/Insphere.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_insphere, organization={Wolfram Research}, title={Insphere}, year={2019}, url={https://reference.wolfram.com/language/ref/Insphere.html}, note=[Accessed: 12-June-2026]}