Question: > 
> **Problem:**
> 
> 
> Given a sequence of $n$ lengths, $L\_1,L\_1,...,L\_n$ where each $L\_k$ is the length of the $k$th side, I need to find a sequence of $n$ points, where $p\_k=(x\_k,y\_k)$, such that $\operatorname{dist}(p\_k,k\_{k+1})=L\_k$ and where $\operatorname{dist}(a,b)$ is the Euclidean distance between $a$ and $b$. So they way the sequence goes, $p\_1=(0,0)$ then $p\_2=(0,L\_1)$. The points must correspond to the ordered clockwise vertices of the simple polygon having the maximum possible area for the given side lengths.
> 
> 
> 

For example, if we were given the lengths $1,1,1$, then obviously this is an equilateral triangle. And the maximum area is given by the coordinates, $(0,0),(0,1),(\sqrt{1-0.25},0.5)$.

Another example, if we were given the lengths $1,2,1,2$, then we would get a rectangle with coordinates $(0,0),(0,1),(2,1),(2,0)$.

How would I work this out for large $n$ or in general for every $n$? Because I cannot think of a way past the case of a square/rectangle.

Answer: 
**Theorem:** For given sidelengths, a cyclic polygon has maximal area.

**Proof:** Let $\{p\_k\}\_{k=1}^n$ be the vertices of the polygon.

Set $v\_k=p\_k-p\_{k-1}$ and $m\_k=\frac12(p\_k+p\_{k-1})$, where $p\_0=p\_n$.

Since the polygon is closed,
$$
\sum\_{k=1}^nv\_k=0\implies\sum\_{k=1}^n\delta v\_k=0\tag1
$$
Since the $|v\_k|$ are given, for $1\le k\le n$,
$$
v\_k\cdot\delta v\_k=0\tag2
$$
The area of the polygon is
$$
A=\frac12\sum\_{j\lt k}v\_j^R\cdot v\_k\tag3
$$
where $(x,y)^R=(y,-x)$. Therefore,
$$
\begin{align}
\delta A
&=\frac12\sum\_{j\lt k}v\_j^R\cdot\delta v\_k-\frac12\sum\_{j\gt k}v\_j^R\cdot\delta v\_k\\
&=\sum\_{k=1}^n(m\_k-p\_0)^R\cdot\delta v\_k\tag4
\end{align}
$$
To maximize $(3)$ under conditions $(1)$ and $(2)$, that is, to guarantee that $(4)$ vanishes when $(1)$ and $(2)$ hold, [orthogonality](https://math.stackexchange.com/a/188306) requires that there be constants $\lambda\_k$ and a point $p$ so that
$$
(m\_k-p\_0)^R=p+\lambda\_kv\_k\tag5
$$
In other words, with $c=p\_0-p^R$
$$
(m\_k-c)\cdot v\_k=0\tag6
$$
which translates to
$$
|p\_k-c|^2=|p\_{k-1}-c|^2\tag7
$$
Thus, all $p\_k$ lie on a circle with center $c$.

$\large\square$
In general, if $A\_1 A\_2\ldots A\_n$ is a $n$-sided polygon and the lengths $l\_1,l\_2,\ldots,l\_{n-1},l\_n$ of $A\_1 A\_2,A\_2 A\_3,\ldots,A\_{n-1} A\_n, A\_n A\_1$ are fixed, the maximum area is achieved by the cyclic polygon, i.e. the polygon having all its vertices on a circle. You may easily prove this fact through [Lagrange multipliers](https://en.wikipedia.org/wiki/Lagrange_multiplier) or Steiner's [symmetrization method](https://en.wikipedia.org/wiki/Symmetrization_methods). It is an istance of the [isoperimetric inequality for polygons](https://mathproblems123.wordpress.com/2012/04/27/2523/), that can be used to prove the usual [isoperimetric inequality in the plane](https://en.wikipedia.org/wiki/Isoperimetric_inequality) through a limit process.