By Xah Lee. Date: .
geometric inversion of regular polygons on square grid
screenshot 2023-02-02 091650
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}} ]
- Use
{Cos[t] , Sin[t]} rr
to generate vertexes of polygon.
- Use
CoordinateBoundsArray
to generate grid of points.