Skip to content

Instantly share code, notes, and snippets.

View shonkwiler's full-sized avatar

Clayton Shonkwiler shonkwiler

View GitHub Profile
(* Source code for ⌗ by Clayton Shonkwiler, available at https://shonk.tumblr.com/post/706176450189049856 *)
flow = Block[{r = 10, t, cols = RGBColor /@ {"#BC002D", "#FFFFFF"}},
ParallelTable[
t = 4 Tan[s];
Show[
ContourPlot[
Im[(t + x + I y) + 1/(t + x + I y)], {x, -r, r}, {y, -r, r},
Contours -> Table[i, {i, -3.45, 3.45, .3}],
ContourShading -> None,
(* An attempt by Clayton Shonkwiler [https://shonkwiler.org] to answer
Matt Enlow's challenge: https://twitter.com/CmonMattTHINK/status/1619704564705554432 *)
Block[{pts},
pts = Select[
Flatten[
Table[
{x, y, Cos[2 \[Pi] (Sqrt[x^2 + y^2])]/9},
{x, -5, 5, .03}, {y, -5, 5, .06}],
1],
(* Code for _As Within, So Without_, which can be seen at https://shonk.tumblr.com/post/124422452191/ *)
Stereo[p_] := p[[;; -2]]/(1 - p[[-1]]);
Manipulate[
ParametricPlot3D[
Stereo[
{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, Cos[t], -Sin[t]}, {0, 0, Sin[t], Cos[t]}}.
{Sin[θ/24] Cos[θ], Sin[θ/24] Sin[θ], Cos[θ/24], 0}],
{θ, -24 π, 0},
(* Mathematica code for the GIF "Reinvention" by Clayton Shonkwiler, which
you can see here: https://shonk.tumblr.com/post/142103728586 *)
tiles = Module[{n = 3, cols, f},
cols = RGBColor /@ {"#bcd6c0", "#f56791", "#46454d"};
f[θ_] := Piecewise[
{{0, θ < 0}, {π/6 (1/2 - 1/2 Cos[π θ]), 0 <= θ < 1},
{π/6, 1 <= θ < 2}, {π/6 (3/2 - 1/2 Cos[π θ]), 2 <= θ < 3}, {π/3, θ >= 3}}];
ParallelTable[
Graphics[{Thickness[.005],
@shonkwiler
shonkwiler / allegory.nb
Created May 2, 2019 22:51
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 =

Keybase proof

I hereby claim:

  • I am shonkwiler on github.
  • I am shonk (https://keybase.io/shonk) on keybase.
  • I have a public key whose fingerprint is 4223 C7BD 72F8 7EB9 FF7C EF75 7362 9D05 B2ED A25A

To claim this, I am signing this object: