Is there a general formula for creating close approximations of regular polygons on a regular lattice?

Prompted by the question What regular polygons can be constructed on the points of a regular orthogonal grid?:

A regular octagon can be approximated on a quad lattice (grid) to about $1\text{%}$ error by knowing that the length of the diagonal of a square is $\sqrt{2}$ (~$1.414$) times as long as its side. With that information we can draw a “regular” octagon by marking the four lattice points 7 orthogonal lengths from a center point and marking the four lattice points 5 diagonal lengths from the same center point.

Is there a general rule that can be applied to create close approximations of other regular polygons on a quad-lattice (triangle, pentagon, enneagon, decagon, dodecagon, etc.)?

Solutions Collecting From Web of "Is there a general formula for creating close approximations of regular polygons on a regular lattice?"