# On the geometric transformations of polygons

Each starry set has the following property:

pts0 = {{1, 0}, {2, 2.5}, {3, 0}, {2.5, 3.5}, {4, 5}, {2.5, 4.5},
{2, 7}, {1.5, 4.5}, {0, 5}, {1.5, 3.5}, {1, 0}};
centroid = Mean[Drop[pts0, -1]];
pts = Table[k pts0 + ConstantArray[(1 - k) centroid, Length[pts0]], {k, 0, 1, 0.2}];
plots = Table[Graphics[{Red, Point[pts[[k]]], Blue, Line[pts[[k]]]}], {k, Length[pts]}];
Show[plots]


while if a set isn't starry, this geometric transformation doesn't work:

pts0 = {{1, 0}, {2, 0}, {2, 3}, {3, 3}, {3, 4}, {0, 4}, {0, 3}, {1, 3}, {1, 0}};
centroid = Mean[Drop[pts0, -1]];
pts = Table[k pts0 + ConstantArray[(1 - k) centroid, Length[pts0]], {k, 0, 1, 0.2}];
plots = Table[Graphics[{Red, Point[pts[[k]]], Blue, Line[pts[[k]]]}], {k, Length[pts]}];
Show[plots]


In the latter case, to get what you want, you can proceed manually:

pts0 = {{1, 0}, {2, 0}, {2, 3}, {3, 3}, {3, 4}, {0, 4}, {0, 3}, {1, 3}, {1, 0}};
offset = {{1, 1}, {-1, 1}, {-1, 1}, {-1, 1}, {-1, -1}, {1, -1}, {1, 1}, {1, 1}, {1, 1}};
pts = Table[pts0 + k offset, {k, 0, 0.5, 0.1}];
plots = Table[Graphics[{Red, Point[pts[[k]]], Blue, Line[pts[[k]]]}], {k, Length[pts]}];
Show[plots]


but I honestly can't see a way to generalize it.

So, I'm here to ask if there's a way to get the first and last graphic result via a single code, thanks!

pts0 = {{1, 0}, {2, 0}, {2, 3}, {3, 3}, {3, 4}, {0, 4}, {0, 3}, {1,