# Area Of Polygon Whose Edges Are In Given Distance From A Given Polygon Edges

I'm handling a problem which I find quite difficult to solve;

My input is a changing number of coordinates (real GPS coordinates), usually I get 4-8 coordinates, and another number,which indicates a distance, let's call it $d$,while $d<0$. Using those coordinates , I need to do the following :

First of all , I need to create a polygon. Later on , using this polygon, I need to create another polygon, with edges that are in distance $d$ from the original polygon's edges. Finally ,I need to calculate the area of the second polygon.

I'd like to know if any of you have got a solution to this problem. By solution I also mean a calculation formula or even a JS/PHP library which may handle this task.