The von Koch curves and the von Koch Snowflakes

f[form_,{a_,b_}]:=AffineTransform[{{b-a,(({{0, -1}, {1, 0}})).(b-a)}\[Transpose],a}][1/Norm[Last[form]-First[form]]TranslationTransform[-First[form]][form]]
g[form_,points_]:=Flatten[Map[f[form,#]&,Partition[points,2,1]],1]
Manipulate[form=Append[Prepend[pts,{-(Sqrt[3]),1}],{(Sqrt[3]),1}];
base=Nest[g[form,#]&,form,refinements];
If[maketriangle,triangle=Join[base,RotationTransform[4π/3.][base],RotationTransform[2π/3.][base]]];
Graphics[{
If[maketriangle,{ColorData[1][1],Polygon[triangle]},{}],
AbsoluteThickness[1.3],Line[If[maketriangle,triangle,base]],
If[refinements==0,{Thick,Line[form]},{}]
},PlotRange->2.7,AspectRatio->Automatic,ImageSize->{500,500}],
"None"->{{pts,{{-(Sqrt[3])/3,1},{0,2},{(Sqrt[3])/3,1}}},{-2.7,-2.7},{2.7,2.7},Locator,LocatorAutoCreate->{1,∞},ContinuousAction->If[refinements>2,False,True]},
{{refinements,0,"refinements"},0,5,1,SetterBar},
{{maketriangle,False,"make triangle"},{True,False}},SaveDefinitions->True,TrackedSymbols:>Manipulate]

Credit : Tammo Jan Dijkema

Creation of this notebook was supported by IT Academy program of Information Technology Foundation for Education (HITSA).