New in Wolfram Mathematica 6: Dynamic Graphical Input | ◄ previous | next ► |
Define Functions That Take Graphics as Arguments
Mathematica 6 lets you define functions that directly compute with graphical input.
In[1]:= | spiral[Graphics[g_, ___], n_] := Graphics[ Table[Rotate[Translate[g, {k, 0}/10], 2 \[Pi] k (2 - GoldenRatio), {0, 0}], {k, n}]] |
In[2]:= | spiral[\!\(\* GraphicsBox[{ {GrayLevel[0], Opacity[1], EdgeForm[None], DiskBox[{0.4868055555555557, 0.5291411111111115}, \ {0.47777777777777786`, 0.4444444444444443}]}, {RGBColor[1., 0.790447852292668, 0.06250095368886854], Opacity[1], EdgeForm[None], DiskBox[{0.53125, 0.5624744444444447}, \ {0.3111111111111112, 0.2777777777777778}]}, {RGBColor[0.8124971389333944, 0., 0.669108110170138], DiskBox[{1.2645833333333334`, -0.03752555555555537}, \ {0.30000000000000027`, 0.25555555555555554`}]}, {RGBColor[0.8124971389333944, 0.07646295872434578, 0.], DiskBox[{0.442361111111111, -0.22641444444444403`}, 0.37777777777777777`]}}, ImageMargins->0., ImageSize->{80., 61.}, PlotRange->All, PlotRangePadding->None]\), 100] |
Out[2]= |