Saturday, December 14, 2019

Hilbert & Sierpinski Curves


RFCP1[f_,s_]:=Module[{k,n,t,x0,y0},
k=RandomInteger[{2,5}]; n=RandomInteger[{5,11}];

x0=Random[]; y0=Random[]; t=RandomInteger[{2,4}];
Graphics[Table[{Hue[i/n],Thickness[.1^t],

GeometricTransformation[f[k]/.Line->BSplineCurve,
RotationTransform[i*Pi/n,{x0,y0}]]},{i,2n}],ImageSize->s,

Background->RGBColor["silver"],
PlotLabel->{k,n,t,x0,y0}]]
{RFCP1[HilbertCurve,400],RFCP1[SierpinskiCurve,400]}


No comments:

Post a Comment