Simplex[{p1,…,pk}]
represents the simplex spanned by points pi.
Simplex
Simplex[{p1,…,pk}]
represents the simplex spanned by points pi.
Details and Options
- Simplex is also known as point, line segment, triangle, tetrahedron, pentachoron, hexateron, etc.
- Simplex represents all convex combinations of the given points
. The region is
dimensional when
are affinely independent and
. - Example simplices where rows correspond to embedding dimension:
- Simplex[n] for integer n is equivalent to Simplex[{{0,…,0},{1,0,…,0},…,{0,…,0,1}}], the unit standard simplex in
. - Simplex can be used as a geometric region and graphics primitive.
- In graphics, the points pi can be Scaled and Dynamic expressions.
- Graphics rendering is affected by directives such as FaceForm, EdgeForm, Opacity, and color.
Examples
open all close allBasic Examples (3)
A Simplex in 3D:
Graphics3D[Simplex[{{0, 0, 1}, {1, 0, 0}, {1, 0, 1}, {1, 1, 1}}]]Graphics[Simplex[{{0, 0}, {1, 1}, {2, 0}}]]Different styles applied to a simplex:
ℛ = Simplex[3];{Graphics3D[{Pink, ℛ}], Graphics3D[{EdgeForm[Thick], ℛ}], Graphics3D[{Opacity[0.25], Blue, ℛ}], Graphics3D[{EdgeForm[Directive[Thick, Dotted]], FaceForm[None], ℛ}]}ℛ = Simplex[{{1, 0, 0}, {1, 0, 1}, {1, 1, 1}, {0, 0, 1}}];Volume[ℛ]RegionCentroid[ℛ]Scope (20)
Graphics (9)
Specification (3)
A standard unit Simplex in 3D:
Graphics3D[Simplex[3]]A 2D simplex spanning three points:
Graphics[Simplex[{{0, 0}, {1, 1}, {2, 0}}]]A simplex in
dimensions is specified by at most
points:
pts = {{0, 0, 1}, {1, 0, 0}, {1, 0, 1}, {1, 1, 1}};Table[Graphics3D[Simplex[Take[pts, n]]], {n, 4}]Styling (3)
Different styles applied to a simplex:
ℛ = Simplex[3];{Graphics3D[{Pink, ℛ}], Graphics3D[{EdgeForm[Thick], ℛ}], Graphics3D[{Opacity[0.25], Blue, ℛ}], Graphics3D[{EdgeForm[Directive[Thick, Dotted]], FaceForm[None], ℛ}]}Color directives specify the face color:
Table[Graphics3D[{c, Simplex[3]}], {c, {Red, Green, Blue, Yellow}}]FaceForm and EdgeForm can be used to specify the styles of the faces and edges:
Graphics3D[{FaceForm[Pink], EdgeForm[Directive[Thick, Dashed, Blue]], Simplex[3]}]Coordinates (3)
Specify coordinates by fractions of the plot range:
Graphics3D[Simplex[{Scaled[{0, 0, 0}], Scaled[{0.5, 0, 0}], Scaled[{0, 0.5, 0}], Scaled[{0, 0, 0.5}]}], PlotRange -> {{0, 10}, {0, 10}, {0, 10}}, Axes -> True]Specify scaled offsets from the ordinary coordinates:
Graphics3D[Simplex[{Scaled[{0, 0, 0.5}, {0, 0, 0}], Scaled[{0, 0, 0.5}, {1, 0, 0}], Scaled[{0, 0, 0.5}, {0, 1, 0}], Scaled[{0, 0, 0.5}, {0, 0, 1}]}], PlotRange -> {{0, 2}, {0, 2}, {0, 2}}, Axes -> True]Points can be Dynamic:
DynamicModule[{x}, {Slider[Dynamic[x], {0, 1}], Graphics3D[Simplex[{Dynamic[{1, 1, 1}x], {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}]]}]Regions (11)
Embedding dimension is the dimension of the space in which the simplex lives:
RegionEmbeddingDimension[Simplex[{{0, 0}, {1, 0}, {0, 1}}]]RegionEmbeddingDimension[Simplex[{{0, 0, 0}, {1, 0, 0}, {0, 1, 1}}]]Table[RegionEmbeddingDimension[Simplex[d]], {d, 5}]Geometric dimension is the dimension of the shape itself:
RegionDimension[Simplex[{{0, 0}, {1, 0}, {0, 1}}]]RegionDimension[Simplex[{{0, 0, 0}, {1, 0, 0}, {0, 1, 1}}]]Table[RegionDimension[Simplex[d]], {d, 5}]RegionMember[Simplex[{{0, 0}, {1, 0}, {0, 1}}], {1 / 2, 1 / 2}]RegionMember[Simplex[{{0, 0}, {1, 0}, {0, 1}}], {1, 1}]Get conditions for point membership:
RegionMember[Simplex[2], {x, y}]RegionMeasure[Simplex[3]]RegionCentroid[Simplex[3]]The measure for a standard simplex in dimension
is
:
Table[RegionMeasure[Simplex[d]], {d, 5}]ℛ = Simplex[{{0, 0}, {1, 1}, {2, 0}}];{RegionDistance[ℛ, {2, 2}], RegionDistance[ℛ, {1 / 2, 1 / 2}]}{Plot3D[Evaluate@RegionDistance[ℛ, {x, y}], {x, -1, 3}, {y, -1, 2}, MeshFunctions -> {#3&}, Mesh -> 5], ContourPlot[Evaluate@RegionDistance[ℛ, {x, y}], {x, -2, 4}, {y, -2, 3}, Contours -> {{0.5, Red}, {1, Green}, {1.5, Blue}}]}ℛ = Simplex[{{0, 0}, {1, 1}, {2, 0}}];{SignedRegionDistance[ℛ, {2, 2}], SignedRegionDistance[ℛ, {1 / 2, 1 / 2}]}Plot3D[SignedRegionDistance[ℛ, {x, y}], {x, -1, 3}, {y, -1, 2}, MeshFunctions -> {#3&}, Mesh -> {{0}}, MeshShading -> {Red, Green}]ℛ = Simplex[{{0, 0}, {1, 1}, {2, 0}}];{RegionNearest[ℛ, {2, 2}], RegionNearest[ℛ, {1 / 3, 1 / 3}]}pts = Table[{1, 0.25} + 1.5{Cos[k 2 π / 16], Sin[k 2 π / 16]}, {k, 0, 15}];
nst = RegionNearest[ℛ, #]& /@ pts;Legended[Graphics[{{Gray, ℛ}, {Thin, Gray, Line[Transpose[{pts, nst}]]}, {Red, Point[pts]}, {Blue, Point[nst]}}], PointLegend[{Red, Blue}, {"start", "nearest"}]]ℛ = Simplex[{{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]Integrate over a simplex:
Integrate[1, {x, y, z}∈Simplex[3]]Integrate[x y z, {x, y, z}∈Simplex[3]]MinValue[{x y - x, {x, y}∈Simplex[2]}, {x, y}]MaxValue[{Exp[x y], {x, y}∈Simplex[2]}, {x, y}]Solve equations constrained by a simplex:
Reduce[(x - 1)(x - 2) == 0 && {x}∈Simplex[1], {x}]Reduce[4x^2 + 4y^2 + 4z^2 == 1 && {x, y, z}∈Simplex[3], {x, y, z}]Applications (1)
Define the Kuhn simplex for dimension
:
KuhnSimplex[n_] := Simplex@Table[If[j < i, 1, 0], {i, 1, n + 1}, {j, n}]KuhnSimplex[2]Graphics[%]KuhnSimplex[3]Graphics3D[%]Table[RegionMeasure[KuhnSimplex[n]], {n, 5}]The centroid in dimension
is
:
Table[RegionCentroid[KuhnSimplex[n]], {n, 5}]Properties & Relations (8)
TriangulateMesh can be used to decompose a volume mesh into simplices:
{ℛ2 = DiscretizeGraphics[Rectangle[]], TriangulateMesh[ℛ2]}{ℛ3 = DiscretizeGraphics[Cuboid[]], TriangulateMesh[ℛ3]}Use options such as MaxCellMeasure to control the number of simplices:
{TriangulateMesh[ℛ2, MaxCellMeasure -> 1], TriangulateMesh[ℛ3, MaxCellMeasure -> 1]}Point is a special case of Simplex:
RegionMember[Point[{{0, 0}}], {x, y}]RegionMember[Simplex[{{0, 0}}], {x, y}]Line is a special case of Simplex:
Subscript[ℛ, 1] = Line[{{0, 0}, {1, 1}}];
Subscript[ℛ, 2] = Simplex[{{0, 0}, {1, 1}}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]Triangle is a special case of Simplex:
Subscript[ℛ, 1] = Triangle[{{0, 0}, {0, 1}, {1, 0}}];
Subscript[ℛ, 2] = Simplex[{{0, 0}, {0, 1}, {1, 0}}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]Tetrahedron is a special case of Simplex:
Subscript[ℛ, 1] = Tetrahedron[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];
Subscript[ℛ, 2] = Simplex[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]Polygon is a generalization of Simplex in dimension 2:
Subscript[ℛ, 1] = Polygon[{{0, 0}, {0, 1}, {1, 0}}];
Subscript[ℛ, 2] = Simplex[{{0, 0}, {0, 1}, {1, 0}}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]ImplicitRegion can represent any Simplex:
Subscript[ℛ, 1] = ImplicitRegion[Subscript[t, 1] ≥ 0 && Subscript[t, 2] ≥ 0 && Subscript[t, 3] ≥ 0 && Subscript[t, 4] ≥ 0 && Subscript[t, 1] + Subscript[t, 2] + Subscript[t, 3] + Subscript[t, 4] ≤ 1, {Subscript[t, 1], Subscript[t, 2], Subscript[t, 3], Subscript[t, 4]}];
Subscript[ℛ, 2] = Simplex[{{0, 0, 0, 0}, {1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]Simplex is the set of convex combinations of its vertices:
{Subscript[p, 1], Subscript[p, 2], Subscript[p, 3], Subscript[p, 4]} = {{1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {2, 3, 4}};
Subscript[ℛ, 1] = ParametricRegion[{Subscript[t, 1]Subscript[p, 1] + Subscript[t, 2]Subscript[p, 2] + Subscript[t, 3]Subscript[p, 3] + Subscript[t, 4]Subscript[p, 4], Subscript[t, 1] ≥ 0 && Subscript[t, 2] ≥ 0 && Subscript[t, 3] ≥ 0 && Subscript[t, 4] ≥ 0 && Subscript[t, 1] + Subscript[t, 2] + Subscript[t, 3] + Subscript[t, 4] == 1}, {Subscript[t, 1], Subscript[t, 2], Subscript[t, 3], Subscript[t, 4]}];
Subscript[ℛ, 2] = Simplex[{Subscript[p, 1], Subscript[p, 2], Subscript[p, 3], Subscript[p, 4]}];RegionEqual[Subscript[ℛ, 1], Subscript[ℛ, 2]]See Also
Point Line Triangle Polygon Tetrahedron Polyhedron MeshRegion
Function Repository: StandardSimplex SimplexBoundary SimplexOrientation SimplexMeasure
Related Guides
History
Text
Wolfram Research (2014), Simplex, Wolfram Language function, https://reference.wolfram.com/language/ref/Simplex.html.
CMS
Wolfram Language. 2014. "Simplex." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Simplex.html.
APA
Wolfram Language. (2014). Simplex. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Simplex.html
BibTeX
@misc{reference.wolfram_2026_simplex, author="Wolfram Research", title="{Simplex}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/Simplex.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_simplex, organization={Wolfram Research}, title={Simplex}, year={2014}, url={https://reference.wolfram.com/language/ref/Simplex.html}, note=[Accessed: 12-June-2026]}