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]}


Koch Curve Examples


RCCP1[s_]:=Module[{a,k,n,t,x0,y0},
k=RandomInteger[{3,6}]; n=RandomInteger[{3,15}];
x0=Random[]; y0=Random[];
a=RandomInteger[{10,170}];t=RandomInteger[{2,4}];
Graphics[{Table[{Hue[2*i/n],Thickness[.1^t],
GeometricTransformation[KochCurve[
k,{0,a \[Degree],-a \[Degree],
-a \[Degree],a \[Degree]}]/.Line->BSplineCurve,
RotationTransform[i*Pi/n,{.5,0}]]},{i,2n}],
Text[{a,k,n},{0,-.7}],Text[{t,x0,y0},{.9,.7}]},
ImageSize->s,Background->RGBColor["silver"]]]
{RCCP1[400],RCCP1[400]}


LaplaceTransform Examples


F[u,v]:=LaplaceTransform[Cos[x + y],{x,y},{u,v}]
Plot3D[{Cos[u+v],Evaluate[F[u,v]]},{u,-Pi,Pi},{v,-Pi,Pi},
Axes->False,PlotStyle->Opacity[.7],
Mesh->{50,50},MeshStyle->Gray,
ImageSize->500,Boxed->False,AspectRatio->1]


Surfaces as Exercises 6


MSPP3[s_]:=Module[{x,y,z},
x=u - u^3/3 + u *v^2; y=v- v^3/3 + v *u^2; z=u^2-v^2;
ParametricPlot3D[Table[{i*x,j*y,k*z},{i,{-2,1}},{j,{-2,1}},{k,{-2,1}}],
{u,-2,2},{v,-2,2},AspectRatio->1,PlotRange->All,PlotPoints->30,
PlotStyle->Directive[Cyan,Opacity[.3]],
Axes->False,Boxed->False,Mesh->{15,25},
MeshStyle->{RGBColor["mintcream"],RGBColor["steelblue"]},
ImageSize->s,Background->RGBColor["silver"],
ViewPoint->{.1,.1,1.4}]];
MSPP3[600]


Surfaces as Exercises 5


MSPP4[a_,b_,c_,s_]:=Module[{x,y,z},
x=v*Cos[u]-a*v^4Cos[b*u];
y=v*Sin[u]+a*v^4Sin[b*u];
z=Exp[c*Log[v]]*Cos[c*u];
ParametricPlot3D[Table[{i*x,j*y,k*z},{i,{-2,2}},{j,{1,2}},{k,{1,2}}],
{u,0,4Pi},{v,0,1},AspectRatio->1,
PlotPoints->30,Axes->False,Boxed->False,
PlotStyle->Directive[Cyan,Opacity[.4]]
Mesh->{30,15},MeshStyle->{White,Cyan},
ImageSize->s,Background->RGBColor["silver"],
ViewPoint->{.1,.4,.9}]];
MSPP4[.5,2,1.5,600]