What is a concave polygon give an example?

What is a concave polygon give an example?

Concave polygon: If at least one angle of a polygon is more than 180°, then it is called a concave polygon. Examples of concave polygons: In the adjoining figure of a hexagon there are six interior angles i.e., ∠ABC, ∠BCD, ∠CDE, ∠DEF, ∠EFA and ∠FAB.

What makes a shape concave?

A concave polygon is a polygon that is not convex. A simple polygon is concave iff at least one of its internal angles is greater than. . An example of a non-simple (self-intersecting) polygon is a star polygon. A concave polygon must have at least four sides.

How do you make a random convex polygon?

One way to make long shapes would be to choose the angles in a way that they are near two opposing locations in a circle. 0 and PI are opposed (0 and 180 degrees). So you could randomly choose either 0 or PI, and then add some randomness around that: int (random (2)) gives either 0 or 1.

Why are convex polygons good to work with?

Alternatively, they are polygons where you always turn the same direction when walking along the boundary. Convex polygons are nice to work with for a variety of reasons, so, especially for testing purposes, it would be nice to be able to generate lots of different convex polygons.

Which is the best way to generate polygons?

I guess a general method (to get elongated polygons too) would be to sample elliptic shapes of various axis ratios at a few points and then perturb them outwards (inflate) randomly. Another idea that does it in a simple way is a perturbative approach. Start from a regular polygon and randomly perturb the vertices.

Is it possible to randomly perturb a polygon?

Start from a regular polygon and randomly perturb the vertices. Note it will keep polygons within some bounding box defined by regular polygon side and max perturbation amplitude. For positive-negative perturbations smaller than some number self-intersections will be impossible.