0
$\begingroup$

I want to construct a convex irregular polygon given a list of sides.

With the condition that the longest side is =< than the sum of the other sides.

I realise there are many possible polygons which can be formed, I would appreciate any pointers.

I have considered a brute force approach using a type of random walk through the angles until the first and last points of the polygon meet, but that does seem silly

Many Thanks

$\endgroup$

1 Answer 1

0
$\begingroup$

Start with a line segment $A_1A_2$ of length $\ell_1$.

Assume we already have points $A_1,\ldots,A_k$ for some $k\le n-2$ and $|A_1A_k|<\ell_{k}+\cdots+\ell_n$. Choose arbitrary $\ell$ with $|A_1A_k|-\ell_{k}<\ell<\ell_{k+1}+\cdots+\ell_n$ and construct $A_{k+1}$ such that $|A_kA_{k+1}|=\ell_{k}$ and $|A_{k+1}A_1|=\ell$.

Repeat until you have $A_{n-1}$ with $|A_1A_{n-1}|<\ell_{n-1}+\ell_n$, and construct $A_N$ such that $|A_{n-1}A_n|=\ell_{n-1}$ and $|A_{n}A_1|=\ell_{n}$.

This will construct a simple polygon with the correct side lengths, but not neccesarily convex. As long as you find a vertex $A_k$ with angle $>180^\circ$, replace it with its reflection at line $A_{k-1}A_{k+1}$. This will terminate after finitely many steps (why?), which means that you reached a convex polygon.

$\endgroup$
1
  • $\begingroup$ Thank you for taking the time to post this answer :) $\endgroup$
    – linuxbun
    Jul 13, 2021 at 22:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .