lego geometry: Segments bent to a given angle make an n sided polygon I swear this isn't homework. I'm actually ordering lego pieces from Pick-a-Brick. They have pipe segments that bend at 180 degrees (straight), 157.5, 135, 112.5, and 90 degrees. I need to know the number of sides of a polygon with those internal angles so that i know how many segments to order. If someone can show me the answer that's great, and if someone can show me how to find the answer that is better. I think i may want to make oval-like elongated polygons by mixing angles (I'm making a zeppelin :) 
 A: Note that all the angles differ from $180^\circ$ by multiples of $22.5^\circ$, which is $\frac{1}{16}$ of the required total rotation of $360^\circ$.  So you can label the pieces as follows:


*

*$0$ ($180^\circ$)

*$1$ ($157.5^\circ$)

*$2$ ($135^\circ$)

*$3$ ($112.5^\circ$)

*$4$ ($90^\circ$).


A complete rotation is produced by joining together pieces whose labels sum to $16$, e.g., $1111111111111111$ or $4444$ or $13333$, with all angles rotating in the same direction.  You can also produce non-convex polygons by using some counter-rotating angles, in which case their labels should be subtracted rather than added, e.g., $443(-3)443(-3)$.  For a given arrangement of $N$ angles, if the polygon is intended to close, then there will be $N-2$ free length parameters left to assign.  For instance, a triangle with fixed angles has a single scale parameter; four right angles produce a rectangle, for which two side lengths can be chosen freely.
A: The external angles of a convex polygon add to 360 degrees.  So if you make one with 157.5 degree bends, the external angle is 180-157.5=22.5 and you need 360/22.5=16 of them.  You probably know that you need 4 90 degree bends to make a polygon.  Yes, you can mix them as long as the sum works out.  There will be constraints on the length of the sides to make the polygon close-think of a rectangle, for example.
