Skip to content

Instantly share code, notes, and snippets.

@shonkwiler
Created May 2, 2019 22:51
Show Gist options
  • Save shonkwiler/6d637ac9466d37afb23da9290c038c99 to your computer and use it in GitHub Desktop.
Save shonkwiler/6d637ac9466d37afb23da9290c038c99 to your computer and use it in GitHub Desktop.
Geometric Allegory source code
data = Module[{n = 512},
Table[
RandomFunction[
TransformedProcess[(1 + x[t]) {Cos[t], Sin[t]},
x \[Distributed] BrownianBridgeProcess[1/12, {2 π i/n, 0}, {2 π + 2 π i/n, 0}], t],
{2 π i/n, 2 π + 2 π i/n, π/50}]["ValueList"][[1]],
{i, 1, n}]
];
allegory =
With[{cols = RGBColor /@ {"#FAFAFA", "#1C1C1C"},
means = Mean[Norm /@ #] & /@ data},
ListLinePlot[
Evaluate[data, InterpolationOrder -> 2, AspectRatio -> 1,
PlotRange -> {{-#, #}, {-#, #}} &[2.1], Axes -> None,
ImageSize -> 2048, Background -> cols[[2]],
PlotStyle -> Table[
Directive[ColorData["DeepSeaColors"][5/2 (means[[i]] - .8)], Thickness[.001]],
{i, 1, Length[means]}]]]];
Export["allegory.png", allegory]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment