I am trying to shrink a polygon by a specific amount where all edges in the new polygon are of equal distance to the old one. To explain better I have a picture here.
If the picture doesnt work I have a link here. https://i.stack.imgur.com/gNWmI.jpg
This is a rough drawing.
I have a point array in ([x,y]) [[390,435], [388,430], [391,425], [425,428], [410,435]]
I am trying to shrink it so the new array [[x1,y1], [x2,y2] ... [x5,y5]]
ensures that the distance between the new area and the original one is 2 at all sides of the area.
How can I do this by only manipulating the co-ordinates. I know I need some kind of scalar vector but I'm unsure how to do this. I am trying to implement this in javascript