SimplePolygonQ

SimplePolygonQ[poly]

gives True if the polygon poly is simple and False otherwise.

Details

  • A polygon is simple if it has no holes and non-intersecting boundary line segments.
  • A simple polygon is topologically equivalent to a disk.

Examples

open allclose all

Basic Examples  (2)

Test whether a polygon is simple:

SimplePolygonQ gives False for non-simple polygons:

Scope  (5)

SimplePolygonQ works on polygons:

Triangle:

Rectangle:

Polygon with holes:

Self-intersecting polygons:

Polygons with disconnected components:

Polygons in :

Applications  (2)

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

Time complexity for algorithms for simple polygons:

Polygon classification using machine learning. Train a classifier function on polygon examples:

Use the classifier function to classify new polygons:

A simple polygon:

A starshaped polygon:

Properties & Relations  (5)

A convex polygon is simple:

The OuterPolygon of a simple polygon is simple:

Simple polygons do not have holes:

Use PolygonDecomposition to decompose a polygon into simple polygons:

Use RandomPolygon to generate a simple polygon:

The number of edges of a simple polygon always equals the number of vertices:

Possible Issues  (1)

For nonconstant polygons, SimplePolygonQ returns False:

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

Text

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

CMS

Wolfram Language. 2019. "SimplePolygonQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SimplePolygonQ.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_simplepolygonq, author="Wolfram Research", title="{SimplePolygonQ}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/SimplePolygonQ.html}", note=[Accessed: 23-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_simplepolygonq, organization={Wolfram Research}, title={SimplePolygonQ}, year={2019}, url={https://reference.wolfram.com/language/ref/SimplePolygonQ.html}, note=[Accessed: 23-November-2024 ]}