# Equidistant polygons

Consider these polygons:

For reasons of simplicity I only consider triangles or polygons with 4 vertices. These shapes are specified by the vertices, the output of the program should be modified vertices.

I am trying to find an algorithm to create a space between the polygons, the colored area depicts the space:

I have tried these things:

• scaling each polygon around it's center of gravity
• scaling the bounding box of each polygon

None of those worked.

I am thinking of an algorithm to modify the corner points of each polygon to create the equidistant space.

What would be a feasible algorithm for this problem?

• What do you mean by "create a space"? What is the input & output of your algorithm? Is the output an image? – CaptainCodeman Jul 9 '14 at 7:12
• @CaptainCodeman legitimate question, I edited my answer – x0r Jul 9 '14 at 7:59
• does just plotting with a larger line weight work for you? if not why? – jk. Jul 9 '14 at 10:05
• @jk. good idea, but unfortunately I need the line weight additionally to create a visible line. The part that is colored in the images is transparent in my program – x0r Jul 9 '14 at 10:38