# Area of a polygon inscribed into an ellipse

I have recently found a paper describing that the percentage area error of a polygon inscribed within a circle can be calculated using the following formula.

The output of the algorithm is a set of $N$ $(x,y)$ points. These $N$ points are connected to form a polygon that approximates the cell membrane. An estimation of the error introduced from this representation can be calculated by comparing a perfectly circular cell membrane to a regular $N$-sided inscribed polygon. The percentage area error due to this underestimation is given as a function of $N$: $$\text{Error} = 1 - \frac{N}{\pi}\;\sin\frac{\pi}{N}\;\cos\frac{\pi}{N} = 1 - \frac{N}{2\pi}\;\sin\frac{2\pi}{N}$$

My question is: How would I construct a similar formula for a polygon inscribed into an ellipse?

I am struggling to figure this out, and it would explain certain differences in the elliptically-shaped I am measuring in my experiment. (we can make an assumption that the cells are perfectly elliptical).

I have no mathematical background, so please be considerate :)

Any ellipse is mapped into a circle by some dilation $\psi$, and any dilation preserves ratios between areas, so the two problems are the same: apply $\psi$, solve the problem in the circle, apply $\psi^{-1}$.

So we have that the convex envelope of $n\geq 3$ points in a ellipse has an area bounded by $$\frac{n}{2\pi}\,\sin\frac{2\pi}{n}$$ times the area of the ellipse, i.e. $\pi a b$, with $a$ and $b$ being the lengths of the semi-axis.

A circle in $(x,y)$ coordinates can be described by parametric equations like this:

\begin{align} x &= x_c + r \cos \theta \\ y &= y_c + r \sin \theta \end{align}

where $(x_c, y_c)$ is the center of the circle and $r$ is the radius.

The points of a regular polygon on that circle are just the points found by setting $\theta = \frac{2\pi}{n} k$ for $k = 0, 1, 2, \ldots, n-1$. That is, we divide the angle of a complete once-around rotation ($2\pi$ radians, which is $360$ degrees) into $n$ equal angles and put points on the circle separated by those angles when seen from the center. Those points are the vertices of a regular polygon.

\begin{align} x &= x_c + a \cos \theta \\ y &= y_c + b \sin \theta \end{align}
we get an ellipse with semi-major axis $a$ and semi-minor axis $b$ aligned with the $x$ and $y$ axes. It is impossible to put more than four points of a regular polygon on an ellipse (unless it is a circle, which is a special case of an ellipse), but you can still put points at $\theta = \frac{2\pi}{n} k$ for $k = 0, 1, 2, \ldots, n-1$. These will still be the vertices of a polygon, just not a regular polygon. The formula for "percentage of the area" is the same as for a circle.
To rotate the ellipse by an angle $\alpha$ (in case you are plotting an ellipse that is not aligned with your coordinate axes),
\begin{align} x &= x_c + a \cos\alpha \cos\theta - b \sin\alpha \sin\theta \\ y &= y_c + b \cos\alpha \sin\theta + a \sin\alpha \cos\theta. \end{align}
If you don't like the way the points are arranged around the ellipse (there is always a point at one end of the semi-major axis since we put a point at $\theta=0$, for example) you can choose points at $\theta = \theta_0 + \frac{2\pi}{n} k$ for $k = 0, 1, 2, \ldots, n-1$ where $\theta_0$ is some constant angle that you chose.
The formula is still $$\text{Error} = = 1 - \frac{N}{2\pi}\;\sin\frac{2\pi}{N}.$$