ConvexRegionQ[reg]
ConvexRegionQ
ConvexRegionQ[reg]
Examples
open all close allBasic Examples (2)
Scope (22)
Special Regions (4)
Regions in
including Point:
ConvexRegionQ[Point[{1}]]ℛ = Interval[{1, 2}];
Region[ℛ]ConvexRegionQ[ℛ]A HalfLine is unbounded:
ConvexRegionQ[HalfLine[{{1}, {2}}]]Regions in
including Point:
ℛ = Point[Table[{t, Sin[t]}, {t, 0, 2π, 2π / 10}]];
Region[ℛ]ConvexRegionQ[ℛ]Line:
ℛ = Line[{{1, 2}, {4, 3}}];
Region[ℛ]ConvexRegionQ[ℛ]ℛ = Polygon[{{0, 0}, {1, 0}, {0.2, 1}, {0.9, 1}}]ConvexRegionQ[ℛ]ℛ = Circle[{1, 2}, 3];
Region[ℛ]ConvexRegionQ[ℛ]Disk:
ℛ = Disk[{1, 2}, {4, 3}];
Region[ℛ]ConvexRegionQ[ℛ]Regions in
including Point:
ℛ = Point[Tuples[Range[2], 3]];
Region[ℛ]ConvexRegionQ[ℛ]Line:
ℛ = Line[{{1, 2, 3}, {6, 5, 4}, {3, 4, 7}}];
Region[ℛ]ConvexRegionQ[ℛ]ℛ = Polygon[Table[{Cos[2π k / 6], Sin[2π k / 6], 0}, {k, 0, 5}], {Range[6]}]ConvexRegionQ[ℛ]ℛ = Cylinder[{{0, 0, 0}, {1, 1, 1}}, 2];
Region[ℛ]ConvexRegionQ[ℛ]Regions in
including Simplex in
:
ConvexRegionQ[Simplex[{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}]]Cuboid in
:
ConvexRegionQ[Cuboid[{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}]]Ball in
:
ConvexRegionQ[Ball[{1, 2, 3, 4, 5, 6, 7}, 8]]Mesh Regions (4)
MeshRegion in 1D:
MeshRegion[{{0}, {1}, {5}}, Line[{1, 2, 3}]]ConvexRegionQ[%]MeshRegion[{{0, 0}, {2, 0}, {3, 1}, {2, 3}, {1, 2}}, Polygon[{1, 2, 3, 4, 5}]]ConvexRegionQ[%]MengerMesh[1, 3]ConvexRegionQ[%]MeshRegion that represents a curve in 2D:
ℛ = MeshRegion[{{0, 0}, {1, 0}, {2, -1}, {2, 1}}, {Line[{{1, 2, 3, 4, 2}}]}]ConvexRegionQ[ℛ]A MeshRegion can have components of different dimensions:
ℛ = MeshRegion[{{0, 0}, {1, 0}, {2, -1}, {2, 1}}, {Line[{{1, 2}}], Polygon[{{2, 3, 4}}]}]ConvexRegionQ[ℛ]BoundaryMeshRegion in 1D:
BoundaryMeshRegion[{{0}, {1}}, Point[{1, 2}]]ConvexRegionQ[%]BoundaryMeshRegion[{{0, 0}, {2, 0}, {3, 1}, {2, 3}, {1, 2}}, Line[{1, 2, 3, 4, 5, 1}]]ConvexRegionQ[%]ConvexHullMesh[RandomReal[1, {100, 3}]]ConvexRegionQ[%]Formula Regions (3)
A parabolic region as an ImplicitRegion:
ℛ = ImplicitRegion[x + 3y ≤ 3 && 2x + y ≥ 1, {x, y}];Region[ℛ]ConvexRegionQ[ℛ]A parabola represented as a ParametricRegion:
ℛ = ParametricRegion[{t, t^2}, {t}];Region[ℛ]ConvexRegionQ[ℛ]ImplicitRegion can have several components of different dimensions:
ℛ = ImplicitRegion[x^2 + y^2 ≤ 1∨(x + 1)^2 + y^2 == 1, {x, y}];Region[ℛ]ConvexRegionQ[ℛ]Derived Regions (6)
RegionIntersection of two regions:
ℛ = RegionIntersection[Disk[{0, 0}, 1], Disk[{0, 1}, 1]];Region[ℛ]ConvexRegionQ[ℛ]RegionUnion of mixed-dimensional regions:
ℛ = RegionUnion[Circle[{0, 0}, 1], Disk[{2, 0}, 1]];Region[ℛ]ConvexRegionQ[ℛ]General BooleanRegion combination:
{r1, r2, r3} = {Disk[], ParametricRegion[{{u v, u ^ 2 - v ^ 2}, -1 ≤ u + v ≤ 1}, {u, v}], Simplex[{{0, 0}, {0, 1}, {1, 0}}]};
ℛ = BooleanRegion[#1 && (#2 || !#3)&, {r1, r2, r3}];
Region[ℛ]ConvexRegionQ[ℛ]ℛ = TransformedRegion[Disk[], {Indexed[#1, 1] + Indexed[#1, 2], Indexed[#1, 1] - Indexed[#1, 2], Indexed[#1, 1] Indexed[#1, 2]}& ];Region[ℛ]ConvexRegionQ[ℛ]ℛ = InverseTransformedRegion[Disk[], {Indexed[#1, 1] + Indexed[#1, 2] + Indexed[#1, 3], Indexed[#1, 1] Indexed[#1, 2]Indexed[#1, 3]}& , 3];Region[%]ConvexRegionQ[ℛ]ℛ = RegionBoundary[Ball[]];ConvexRegionQ[ℛ]Geographic Regions (3)
Test a polygon with GeoPosition:
ℛ = Polygon[GeoPosition[{{{40.083441, -88.235716}, {40.083607, -88.257488}, {40.082603, -88.257149},
{40.076136999999996, -88.25740499999999}, {40.076178, -88.270888}, {40.076516, -88.271558},
{40.083686, -88.271512}, {40.083659999999995, -88.267046}, ... 33323}, {40.098112, -88.228687},
{40.095216, -88.228627}, {40.095179, -88.238547}, {40.094480999999995, -88.238546},
{40.094508999999995, -88.23267}, {40.094106, -88.232556}, {40.090666999999996, -88.232477},
{40.090741, -88.235745}}}]];ConvexRegionQ[ℛ]Polygons with GeoPositionXYZ:
ℛ = Polygon[GeoPositionXYZ[{{{150451.6968462432, -4.884430486484052*^6, 4.085078564164219*^6},
{148595.27532671497, -4.884475441490381*^6, 4.085092666620835*^6},
{148626.35829777512, -4.884546311005128*^6, 4.0850073717259285*^6},
{148618.5908634042 ... 7*^6, 4.0860187668081024*^6},
{150697.56410771207, -4.8836599487428395*^6, 4.085984535480795*^6},
{150711.88303095422, -4.883905546449982*^6, 4.0856924143435075*^6},
{150433.15479548014, -4.883908845676418*^6, 4.0856987003255524*^6}}}]];ConvexPolygonQ[ℛ]Polygons with GeoPositionENU:
ℛ = Polygon[GeoPositionENU[{{{3378.2547059731055, -3369.2234780923936, -0.7440009205072329},
{1521.3211635380246, -3351.391253626573, -0.022340134218666208},
{1550.2571145363192, -3462.8657556618973, -0.08899812728964207},
{1528.5672303494055, -418 ... 63383291193, -0.37494203351275246},
{3654.121991908476, -2566.7472331234085, -0.5214977847472255},
{3375.420726854886, -2558.6597093173914, -0.3648706331350695}}},
GeoPosition[{40.11379115639895, -88.2753251202516, -1.0415787873318691}]]];ConvexPolygonQ[ℛ]The area of a polygon with GeoGridPosition:
ℛ = Polygon[GeoGridPosition[{{{-0.9950503945490105, 1.2366760550756015},
{-0.9952074890903578, 1.2369207053693891}, {-0.9952196732768064, 1.2369073327446167},
{-0.9953160063787643, 1.236848436956935}, {-0.9954141759436825, 1.2369993898475449},
{-0. ... 197645333103}, {-0.9949098578570917, 1.2368130881428654},
{-0.9948663952535768, 1.2367477711687371}, {-0.9948714472169538, 1.2367426500757825},
{-0.9949211061652593, 1.2367089232486177}, {-0.9949439717990124, 1.236746107097628}}}, "Bonne"]];ConvexPolygonQ[ℛ]ConvexRegionQ works on polygons with geographic entities:
ℛ = Polygon[["france"]];ConvexPolygonQ[ℛ]CSG Regions (1)
CSGRegion in 2D:
CSGRegion["Difference", {Disk[], Disk[{1 / 2, 1 / 2}]}]ConvexRegionQ[%]CSGRegion["Difference", {Cube[2], Cylinder[{{1, 1, 1}, {1, -1, 1}}]}]ConvexRegionQ[%]Subdivision Regions (1)
SubdivisionRegion in 2D:
SubdivisionRegion[Rectangle[]]ConvexRegionQ[%]SubdivisionRegion[Tetrahedron[]]ConvexRegionQ[%]Applications (5)
Row[Table[Region[Style[f[]]], {f, {Tetrahedron, Cube, Octahedron, Dodecahedron, Icosahedron}}]]Test whether a basic region is convex:
Multicolumn[Table[Region[Style[f, If[ConvexRegionQ[f] === False, Red]], ImageSize -> 40], {f, {...}}], 5, Spacings -> 2]The convex hull of a compound of five tetrahedra is a dodecahedron:
ℛ = DiscretizeGraphics[PolyhedronData["TetrahedronFiveCompound"]]ConvexRegionQ[ℛ]ConvexHullRegion[MeshCoordinates[ℛ]]ConvexRegionQ[%]Test whether a polygon is concave:
concavePolygonQ[poly_] := Not[ConvexRegionQ[poly]]Table[RandomPolygon[RandomInteger[{3, 5}]], {4}]concavePolygonQ /@ %Generate random polygons for testing algorithms and verification of time complexity:
n = Table[Floor[10 ^ i], {i, 1, 4, 1 / 40}];polygons = Table[RandomPolygon[{"Convex", i}], {i, n}];AllTrue[polygons, ConvexRegionQ]Time complexity for algorithms for convex polygons:
t = First[AbsoluteTiming[ConvexRegionQ[#]]]& /@ polygons;Show[{ListPlot[Transpose[{n, t}], PlotRange -> All, Joined -> True, AxesLabel -> {"n", "Time"}], Plot[Style[Evaluate[Fit[Transpose[{n, t}], {1, x}, x]], Red, Dashed], {x, 0, 10 ^ 5}]}]Properties & Relations (3)
If two regions are convex, the intersection is convex:
{Subscript[ℛ, 1], Subscript[ℛ, 2]} = {[image], [image]};Subscript[ℛ, 3] = RegionIntersection[Subscript[ℛ, 1], Subscript[ℛ, 2]]ConvexRegionQ /@ {Subscript[ℛ, 1], Subscript[ℛ, 2], Subscript[ℛ, 3]}The InverseTransformedRegion of a convex region is convex:
Subscript[ℛ, 1] = Rectangle[];
Subscript[ℛ, 2] = InverseTransformedRegion[Rectangle[], RotationTransform[π / 3], 2];Region /@ {Subscript[ℛ, 1], Subscript[ℛ, 2]}ConvexRegionQ /@ {Subscript[ℛ, 1], Subscript[ℛ, 2]}Using ConvexHullRegion to create a convex region:
x = ConvexHullRegion[RandomReal[{-1, 1}, {50, 2}]]ConvexRegionQ[%]Possible Issues (1)
ConvexRegionQ returns False for nonconstant regions:
𝒫 = Polygon[{{a, b}, {c, d}, {e, f}, {g, h}}];ConstantRegionQ[𝒫]See Also
Related Guides
History
Text
Wolfram Research (2020), ConvexRegionQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ConvexRegionQ.html.
CMS
Wolfram Language. 2020. "ConvexRegionQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ConvexRegionQ.html.
APA
Wolfram Language. (2020). ConvexRegionQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ConvexRegionQ.html
BibTeX
@misc{reference.wolfram_2026_convexregionq, author="Wolfram Research", title="{ConvexRegionQ}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ConvexRegionQ.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_convexregionq, organization={Wolfram Research}, title={ConvexRegionQ}, year={2020}, url={https://reference.wolfram.com/language/ref/ConvexRegionQ.html}, note=[Accessed: 13-June-2026]}