Wednesday, December 11, 2019

Polygons with Random Coefficients


  RRP[n_,o_,s_,c1_,c2_]:=Graphics[
{FaceForm[Directive[RGBColor[c1],Opacity[.1o]]],
EdgeForm[Directive[RGBColor[c1],Opacity[.2o]]],
Polygon[Outer[#1.#2 &,Table[RotationMatrix[a],
{a,-Pi,Pi-Pi/o,Pi/o}],
Join[Map[ReflectionMatrix[{1,1}].# &,#],#]&@Join[{{0,0}},
RandomReal[{-1,1},
{RandomInteger[{4,n}],2}]],1]]},
Background->RGBColor[c2],ImageSize->s]
{RRP[32,3,300,"ghostwhite","steelblue"],
RRP[16,4,300,RandomReal[1,3],"black"]}


RRP[32,3,600,RandomReal[1,3],"ghostwhite"]

No comments:

Post a Comment