# How can i find the lenght of a side of a polygon with known number of sides that has a circle with known diameter inscribed in it?

How can i find the lenght of a side of a polygon with known number of sides that has a circle with known diameter inscribed in it? I'm a web-developer intereseted in this certain problem, that would be the solution to one of my aplications. And also is there a relation betwen a polygon that has a inscribed polygon with knwon distance betwen their sides? It would help even an answer for particular cases like pentagon or hexagon. I hope i've been specific enough :)

-

For an $n$-gon the relations between circumscribed radius $R$, inscribed radius $\rho$ and side length $a$ are $$\frac \rho R = \cos\frac\pi n$$ $$\frac a R = 2\sin\pi n$$ $$\frac a \rho = 2\tan\pi n.$$
For the second problem: If you have a polygon with side length $a$ and inscribed radius $\rho$, then the side length $a'$ for a smaller $n$-gon at distance $d$ is given by $$\frac{a-a'}{a}=\frac d\rho$$ i.e. $$a'=a\cdot\left(1-\frac d\rho\right).$$ Of course other data such as inscribed or circumscribed radius scale by the same factor $1-\frac d\rho$.
You don't even need the "known distance". If the "known diameter" is $d$, then let the vertices of the pentagon be $A, B, C, D, E$ in counterclockwise order. Let $O$ be the center of the circle, and let $M$ be the midpoint of $AB$. Consider the right-angled triangle $AOM$; note that $\angle AOM = 360^\circ/10 = 36^\circ$. Hence, by trigonometry, $\overline{AM}/\overline{MO} = \overline{AM}/(d/2) = \tan(36^\circ)$. Use that to solve for $2\overline{AM}$, which is the side length of the outer pentagon.