Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diffuse[point_, t_] :=
- Total[Join[{point},
- RandomReal[NormalDistribution[0, 0.5], {t, 2}]]];
- img = ImageCrop[
- Rasterize[
- Graphics[Text[Style["diffusion", FontSize -> 100], {0, 0}]]]];
- imgdata = ImageData[img];
- time[x_, \[Alpha]_, \[Beta]_] :=
- Module[{g = x/Length[imgdata[[1]]]},
- Floor[\[Alpha] Abs[g]^\[Beta] + 1]];
- coords = Flatten[
- Table[{{i, -j}, imgdata[[j]][[i]]}, {j, Length[imgdata]}, {i,
- Length[imgdata[[1]]]}], 1];
- frame[\[Alpha]_, \[Beta]_] :=
- Module[{points, diffused},
- points = Map[#[[1]] &, Select[coords, Norm[#[[2]] ] < 0.01 &]];
- diffused =
- Map[{ColorData["TemperatureMap"][#[[1]]/Length[imgdata[[1]]]],
- Point[diffuse[#, time[#[[1]], \[Alpha], \[Beta]]]]} &, points];
- Graphics[diffused, Background -> Black, ImageSize -> {1000}]];
- frame[200, 2.5]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement