A non-concave and non-convex polygon called

polygonsterminology

I am writing a software function to plot the outer points of an n-sided polygon and I'm having trouble ensuring I use the correct terminology. The function I've written simply renders the calculated points of a predetermined polygon in two dimensional space. These polygons are neither convex nor concave and thus I believe the name I should give the function is Render Uniform Polygon; however, I believe uniform may not be the correct word and could end up in a debate over the name. The function itself performs three actions to achieve the goal:

  1. Calculate the angle of each point $\theta_n$.
  2. Calculate the new position $P_n$.
  3. Render a 3px by 3px dot at the new position.

The math for calculating $\theta_n$ is:

$$\theta_n = \frac{\biggl(\bigl(\frac{360°}{p}\bigr)n + \phi\biggr)\pi}{180°}$$

Where:

  • $p$ is the number of points in the polygon.
  • $n$ is the current point.
  • $\phi$ is the global rotation angle.

Once $\theta_n$ has been calculated with the math above, I then use it to calculate the new position with the following:

$$P_{_n{x, y}} = C_{x, y} + (\cos(\theta_n), \sin(\theta_n))r$$

Where:

  • $P_n$ is current point's position.
  • $C_{x, y}$ is the center of the polygon.
  • $r$ is the radius of the polygon.

This method can be used to render any polygon with three sides or more, and since the radius is predefined there isn't a case where the polygon can be convex or concave.


What is a polygon that is neither convex nor concave called?

Best Answer

As far as I can see your polygon is convex. It's a regular polygon whose vertices are equidistant on the circle with radius $r$ and center $C$.

Related Question