How to characterize the regularity of a polygon? In my research, I've recently started to play with Voronoi tessellations. I currently have a Python code that creates the tessellation and I am trying to color the polygonal regions according to their regularity. The best-case scenario would be to have a color scale (let's say from red to blue) where regions in red would be the "most irregular" (in some sense) and regions in blue would be the "most regular" (in some sense). It is not strictly necessary to have a scale; I would happily settle to color regions by range, e.g., if the region is "very irregular" I color it red, if it is "sort of regular" I color it yellow and if it is "regular" I color it green.
What I am looking for is a way to associate a number to say how regular a polygon is (for now, I am more interested in hexagons, but it wouldn't hurt to have something for a general polygon).
For example, the first idea that came to mind was taking the average of the angles and measuring the difference from this average to the expected internal angle of the hexagon (which is $2\pi/3$), but this does not work because the average is always $2\pi/3$ since the polygons I'm working with are always convex.
Some ideas that I have discussed with my advisor are

*

*looking at $\bar{D}/\sigma(D)$, where $D$ is the set of distances from the vertices of the polygon to it's center, $\bar{D}$ is the average of $D$ and $\sigma(D)$ is the standard deviation of $D$. This ratio ranges from 0 ("maximum" irregularity) to $\infty$ ("maximum" regularity);

*looking only at $\sigma(D)$, which ranges from 0 ("maximum" regularity) to $\infty$ ("maximum" irregularity).

If possible, I would like to work only with angles due to the way the code I have produces the Voronoi tessellation. However, my intuition says that either

*

*I'll have to forget angles altogether and look only at distances;

*I'll have to look at angles and at distances.

Therefore, my question is: is there such a metric for characterizing the regularity of a polygon that involves only the internal angles? If not, is there a more interesting metric that involves distances than the ones I listed above?
I would be more than happy to share more information about the problem if need be.
Edit: this picture it a prototype to what I am trying to do.
The green regions are hexagons (regular or not), the white ones are the infinite regions of the tessellation and the red ones are the finite regions that are not hexagons.
 A: All indices are in $\mathbb Z\bmod6$.
Let $z_k=\frac{\ell_{k,k+1}}{\ell_{k-1,k}}e^{i(\pi-\theta_k)}=\frac{v_{k+1}-v_k}{v_k-v_{k-1}}$, where $\ell$ is edge length, $\pi-\theta$ is vertex exterior angle, and $v_k\in\mathbb C$ is the $k$th vertex of the polygon. So the complex number $z_k$ scales and rotates one edge at $v_k$ to the other edge, maintaining orientation. (Note that $\prod_kz_k=1$, and $\sum_k\prod_{m=0}^{k-1}z_m=0$.) One measure of irregularity is $\sum_k|z_{k+1}-z_k|^2$.
Another approach is to take the Discrete Fourier Transform of the vertices, i.e. represent the polygon as a $\mathbb C$-linear combination of regular polygons (allowing overlapping vertices or self-intersection): $v_k=\sum_mc_me^{i2\pi mk/6}$. The coefficient $c_0$ encodes the polygon's centre, which we don't care about. The polygon is regular when only one other coefficient $c_m$ is non-zero; however, it's non-convex unless $m=1$ (or maybe $m=-1$, but that has the wrong orientation). So you can use $\sum_{m\neq0,1}|c_m|^2$ as a measure of irregularity. (And for scale invariance you can divide this by $\sum_{m\neq0}|c_m|^2$.)
A: Internal angles are not enough to determine the regularity of a polygon. E.g., angles of $2\pi/3$ between sides of length $1,1,4,1,1,4$ make an irregular hexagon.
For a metric of regularity, I suggest $$A \ / \ \sum d_i^2$$ where $A$ is the area of the hexagon and the $d_i$ are the side lengths.
Using this metric:

*

*regular hexagons have a regularity of $\sqrt{3}/4 \sim 0.433$;

*irregular hexagons have lower regularity;

*the hexagon with six unit lengths along a $1\times2$ rectangle has a regularity of $1/3$;

*the hexagon with six unit lengths along a $0\times 3$ rectangle has a regularity of $0$.

The area is easy to calculate as $\sum (x_i y_{i+1}-x_{i+1}y_i)/2$. So the metric should be good for getting a stable optimization, since the numerator and denominator are both simple quadratic functions of the coordinates, not requiring any square roots.
