WOLFRAM

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)Summary of the most common use cases

Test whether a polygon is simple:

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

SimplePolygonQ gives False for non-simple polygons:

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

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

SimplePolygonQ works on polygons:

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

Triangle:

Out[3]=3

Rectangle:

Out[4]=4

Polygon with holes:

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

Self-intersecting polygons:

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

Polygons with disconnected components:

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

Polygons in :

Out[2]=2

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

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

Out[25]=25

Time complexity for algorithms for simple polygons:

Out[27]=27

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

Out[2]=2

Use the classifier function to classify new polygons:

Out[5]=5

A simple polygon:

Out[7]=7

A starshaped polygon:

Out[9]=9

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

A convex polygon is simple:

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

The OuterPolygon of a simple polygon is simple:

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

Simple polygons do not have holes:

Out[4]=4

Use PolygonDecomposition to decompose a polygon into simple polygons:

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

Use RandomPolygon to generate a simple polygon:

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

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

Out[2]=2

Possible Issues  (1)Common pitfalls and unexpected behavior

For nonconstant polygons, SimplePolygonQ returns False:

Out[2]=2
Out[3]=3
Wolfram Research (2019), SimplePolygonQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SimplePolygonQ.html.
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.

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.

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

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: 10-January-2025 ]}

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

BibLaTeX

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

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