WOLFRAM

gives True if reg is a convex region and False otherwise.

Details

  • A region is convex if no line segment between two points in the region ever goes outside the region.
  • A region is convex if for points p1,p2reg, λ p1+(1-λ)p2reg for all 0λ1.

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Test whether a rectangle is convex:

Out[1]=1

A circle is not a convex region:

Out[1]=1
Out[2]=2

Scope  (20)Survey of the scope of standard use cases

Special Regions  (4)

Regions in including Point:

Out[1]=1

Interval:

Out[3]=3
Out[4]=4

A HalfLine is unbounded:

Out[5]=5

Regions in including Point:

Out[1]=1
Out[2]=2

Line:

Out[3]=3
Out[4]=4

Polygon:

Out[5]=5
Out[6]=6

Circle:

Out[7]=7
Out[8]=8

Disk:

Out[9]=9
Out[10]=10

Regions in including Point:

Out[1]=1
Out[2]=2

Line:

Out[3]=3
Out[4]=4

Polygon:

Out[5]=5
Out[6]=6

Cylinder:

Out[7]=7
Out[8]=8

Regions in including Simplex in :

Out[1]=1

Cuboid in :

Out[2]=2

Ball in :

Out[3]=3

Mesh Regions  (4)

MeshRegion in 1D:

Out[1]=1
Out[2]=2

2D:

Out[3]=3
Out[4]=4

3D:

Out[5]=5
Out[6]=6

MeshRegion that represents a curve in 2D:

Out[1]=1
Out[2]=2

A MeshRegion can have components of different dimensions:

Out[1]=1
Out[2]=2

BoundaryMeshRegion in 1D:

Out[1]=1
Out[2]=2

2D:

Out[3]=3
Out[4]=4

3D:

Out[5]=5
Out[6]=6

Formula Regions  (3)

A parabolic region as an ImplicitRegion:

Out[2]=2
Out[3]=3

A parabola represented as a ParametricRegion:

Out[2]=2
Out[3]=3

ImplicitRegion can have several components of different dimensions:

Out[2]=2
Out[3]=3

Derived Regions  (6)

RegionIntersection of two regions:

Out[2]=2
Out[3]=3

RegionUnion of mixed-dimensional regions:

Out[2]=2
Out[3]=3

General BooleanRegion combination:

Out[1]=1
Out[2]=2

TransformedRegion:

Out[2]=2
Out[3]=3

InverseTransformedRegion:

Out[2]=2
Out[3]=3

RegionBoundary:

Out[2]=2

Geographic Regions  (3)

Test a polygon with GeoPosition:

Out[2]=2

Polygons with GeoPositionXYZ:

Out[4]=4

Polygons with GeoPositionENU:

Out[6]=6

The area of a polygon with GeoGridPosition:

Out[2]=2

ConvexRegionQ works on polygons with geographic entities:

Out[2]=2

Applications  (5)Sample problems that can be solved with this function

Platonic solids are convex:

Out[1]=1

Test whether a basic region is convex:

Out[1]=1

The convex hull of a compound of five tetrahedra is a dodecahedron:

Out[1]=1
Out[2]=2
Out[3]=3
Out[4]=4

Test whether a polygon is concave:

Out[2]=2
Out[3]=3

Generate random polygons for testing algorithms and verification of time complexity:

Out[3]=3

Time complexity for algorithms for convex polygons:

Out[5]=5

Properties & Relations  (3)Properties of the function, and connections to other functions

If two regions are convex, the intersection is convex:

Out[2]=2
Out[3]=3

The InverseTransformedRegion of a convex region is convex:

Out[2]=2
Out[3]=3

Using ConvexHullRegion to create a convex region:

Out[1]=1
Out[2]=2

Possible Issues  (1)Common pitfalls and unexpected behavior

ConvexRegionQ returns False for nonconstant regions:

Out[2]=2
Wolfram Research (2020), ConvexRegionQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ConvexRegionQ.html.
Wolfram Research (2020), ConvexRegionQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ConvexRegionQ.html.

Text

Wolfram Research (2020), ConvexRegionQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ConvexRegionQ.html.

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.

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

Wolfram Language. (2020). ConvexRegionQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ConvexRegionQ.html

BibTeX

@misc{reference.wolfram_2025_convexregionq, author="Wolfram Research", title="{ConvexRegionQ}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ConvexRegionQ.html}", note=[Accessed: 27-April-2025 ]}

@misc{reference.wolfram_2025_convexregionq, author="Wolfram Research", title="{ConvexRegionQ}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ConvexRegionQ.html}", note=[Accessed: 27-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_convexregionq, organization={Wolfram Research}, title={ConvexRegionQ}, year={2020}, url={https://reference.wolfram.com/language/ref/ConvexRegionQ.html}, note=[Accessed: 27-April-2025 ]}

@online{reference.wolfram_2025_convexregionq, organization={Wolfram Research}, title={ConvexRegionQ}, year={2020}, url={https://reference.wolfram.com/language/ref/ConvexRegionQ.html}, note=[Accessed: 27-April-2025 ]}