Draw a polygon inside another polygon

Revision en2, by shank_punk, 2016-12-31 04:04:49

I'm facing a problem while trying to write a code that'll give the vertices of the inner polygon if the Outer polygon's vertices are given along with the "setback values" of each face.

in the example above, we'll be given the outer polygon vertices and the setback values a, b, c where a = distance from face A of the outer polygon to face A' of the inner polygon, b = distance from face A of the outer polygon to face B' and so on...

What's an optimal way to find the vertices of the inner polygon?

I tried to solve it but I'm unable to find the correct vertices while the slope value is > 0.

The number of vertices will be from 1 to 100 and the area of the polygon will not exceed 10^6.

Your help will be much appreciated :)

Thank you

Tags algorithm, polygon

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English shank_punk 2016-12-31 04:04:49 7 Tiny change: 'ated :) \nThanks' -> 'ated :) \n\nThank you'
en1 English shank_punk 2016-12-23 01:53:08 851 Initial revision (published)