Let $n\geq 3$ be an integer and $0<\alpha\_1, \dots ,\alpha\_{n-2}<1$. Let's say a tuple of positive numbers $(e\_1,\dots, e\_n)$ is *nice* if there is a convex $n$-gon $A\_1\dots A\_n$ such that $\hat A\_i=\pi\alpha\_i$ and edge lengths $\overline{A\_iA\_{i+1}}=e\_i$.


(The convexity condition probably will make things rather more complicated, so I will be happy to drop that)


Pythagorean theorem says that with $n=3$ and $\alpha\_1=1/2$, the nice tuples are precisely the intersection of the variety $e\_2^2=e\_1^2+e\_3^2$ with the positive orthant. Of course similar result holds for any $\alpha\_1$ and $n=3$.


Question: what about $n>3$? My guess is the set of nice tuples is still the intersection of an algebraic scheme with the positive orthant (or some polytope in it). If so, what is known about the equations defining such schemes (obviously they are homogenous, but what about things like degrees)? Any reference for such kind of problems?


(Update Apr 2021): I asked Hendrik Lenstra and he confirmed that the statement mentioned by Henri Cohen below appeared as a Proposition in his thesis (which unfortunately he has no copies left). Also according to Lenstra, it might have appeared in [Nieuw Archief voor Wiskunde](http://www.nieuwarchief.nl/), but quite probably in Dutch, and I have not been able to track it down.



Generalizing Pythagorean Theorem: equations defining edges of a (convex) $n$-gon with $n-2$ prescribed angles?
One has $$\overrightarrow{A\_nA\_1} + \cdots + \overrightarrow{A\_{n-2}A\_{n-1}} = \overrightarrow{A\_nA\_{n-1}}.$$
Taking the squared norm of both sides one arrives at
$$\sum\_{i=1}^{n-1} e\_{i-1}^2 + 2 \sum\_{1\le i < j\le n-1}e\_{i-1}e\_{j-1}\cos\sum\_{k=i}^{j-1}(\pi-\alpha\_i) = e\_{n-1}^2,$$
which is the equation we are looking for.


For $n=4$ I studied this equation some years ago from a different viewpoint: given the side lengths of a quadrilateral, how are two of its adjacent angles related? The above equation answers this question. It turns out that it can be rewritten as follows:
$$a\_1^2a\_2^2x\_{22} + a\_1^2x\_{20} + a\_2^2x\_{02} + 2a\_1a\_2x\_{11} + x\_{00} = 0,$$ where
\begin{gather\*}
a\_1=\cot\frac{\alpha\_1}2, \quad a\_2 = \cot\frac{\alpha\_2}2,\\
x\_{22} = (e\_1-e\_2-e\_3-e\_4)(e\_1-e\_2+e\_3-e\_4),\\
x\_{20} = (e\_1+e\_2+e\_3-e\_4)(e\_1+e\_2-e\_3-e\_4),\\
x\_{02} = (e\_1-e\_2+e\_3-e\_4)(e\_1-e\_2-e\_3+e\_4),\\
x\_{11} = -4e\_2e\_4,\\
x\_{00} = (e\_1+e\_2-e\_3+e\_4)(e\_1+e\_2+e\_3+e\_4).
\end{gather\*}


