Compute the Perimeter of a Polygon