Geometric Inversion, 2D Grid, Polygon

By Xah Lee. Date: .

geometric inversion of regular polygons on square grid

geometric inversion reg poly 2023-02-02 YPd6D
geometric inversion reg poly 2023-02-02 YPd6D
geometric inversion 2021-09-27 zfzJ
geometric inversion 2021-09-27 zfzJ
geoInv = ((With[{x662 = #.#}, If[ x662 < 0.00000001, #, #/x662] ]) &);

gridWidth = 2;
gridDivN = 13;
step = gridWidth/gridDivN;
polygonNumOfSides = 8;
polygonRadius =step /2 2.2 ;
polygonRotation = 2 Pi/8;

polygonVertexes = ((({Cos[#], Sin[#]} polygonRadius) &) /@ Range[polygonRotation, 2 π+polygonRotation - 2 π/polygonNumOfSides/2, 2 π/polygonNumOfSides ]);

gp1 =
Map[ Function[{x}, GraphicsComplex[ ((x+#) &) /@ polygonVertexes, Line @ Append[Range @polygonNumOfSides, 1] ]],
CoordinateBoundsArray[{{-gridWidth/2, gridWidth/2}, {-gridWidth/2, gridWidth/2}}, step]
, {2}];

gp2= gp1 /. GraphicsComplex[x_, r__] :> GraphicsComplex[geoInv /@ x, r];

gr1 = Graphics[gp1, Axes->True ]
gr2 = Graphics[gp2, Axes->True, PlotRange->4 ]

GraphicsGrid[ {{gr1, gr2}} ]