# ConvexRegionQ

ConvexRegionQ[reg]

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)

Test whether a rectangle is convex:

A circle is not a convex region:

## Scope(20)

### Special Regions(4)

Regions in including Point:

A HalfLine is unbounded:

Regions in including Point:

Line:

Disk:

Regions in including Point:

Line:

Regions in including Simplex in :

Cuboid in :

Ball in :

### Mesh Regions(4)

MeshRegion in 1D:

2D:

3D:

MeshRegion that represents a curve in 2D:

A MeshRegion can have components of different dimensions:

BoundaryMeshRegion in 1D:

2D:

3D:

### Formula Regions(3)

A parabolic region as an ImplicitRegion:

A parabola represented as a ParametricRegion:

ImplicitRegion can have several components of different dimensions:

### Derived Regions(6)

RegionIntersection of two regions:

RegionUnion of mixed-dimensional regions:

General BooleanRegion combination:

### Geographic Regions(3)

Test a polygon with GeoPosition:

Polygons with GeoPositionXYZ:

Polygons with GeoPositionENU:

The area of a polygon with GeoGridPosition:

ConvexRegionQ works on polygons with geographic entities:

## Applications(5)

Platonic solids are convex:

Test whether a basic region is convex:

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

Test whether a polygon is concave:

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

Time complexity for algorithms for convex polygons:

## Properties & Relations(3)

If two regions are convex, the intersection is convex:

The InverseTransformedRegion of a convex region is convex:

Using ConvexHullRegion to create a convex region:

## Possible Issues(1)

ConvexRegionQ returns False for nonconstant regions: