It works by brute force, enumerating for each successive integerradius sets of integer sides that produce a polygon. It takes anargument that is a limit on the number of sides to allow it toinvestigate small numbers of sides for a range of radiuses in areasonable amount of time. It has an optional "-d" argument to makeall the sides different.

It uses floating point trig functions to determine the angles, so it(a) has to have a small tolerance to allow for inexact calculation and(b) produces false positives. I've used double precision (assumed tobe 64 bit) with a generous tolerance, and then check the successfulresults with 1000-bit precision using Gnu MPFR. Results that fail thecheck have a "?" in front of them; reject them.