Original artwork

Original P5.JS Processing code

a=(x,y,d=.5+5*cos(o=mag(k=x/8-12.5,e=y/8-12.5)**2/169))=>stroke((d*sin(k)*sin(t*4+e))**2*w,36).point(x+d*k*sin(d*2+o+t)+
e*cos(e+t)+100,o*135-y/4-d*6*cos(d*3+o*9+t)+125)
t=0,draw=$=>{t||createCanvas(w=400,w);background(6);for(t+=PI/120,i=4e4;i--;)a(i%200,i/200)}

Original formatted P5.JS Processing code

a = (​​ x, y,​​ d = 0.5 + 5 * cos (​​ o = mag (​​ k = x/8 - 12.5,​​ e = y/8 - 12.5​​ ) ** 2 / 169​​ )​​ ) = > ​​ stroke ((d * sin (k) * sin (t*4 + e)) ** 2 * w, 36)​​ . point (​​ x + d*k*sin (d*2 + o + t) + e*cos (e + t) + 100,​​ o*135 - y/4 - d*6*cos (d*3 + o*9 + t) + 125​​ );​​​​t = 0,​​draw = $ = > {​​ t || createCanvas (w = 400, w);​​ background (6);​​ ​​ for (​​ t += PI/120, ​​ i = 4 e4; ​​ i--;​​ )​​ a (i % 200, i / 200);​​ };

Open AI ChatGPT o1 model prompt:

Translate the following Processing code to Wolfram. Final animation should be expressed via Manipulate function.

Original artist on 𝕏

◼
  • https://x.com/yuruyurau
  • Original artwork on 𝕏

    ◼
  • https://x.com/yuruyurau/status/1865420201086636376
  • Interactive animation

    Manipulate[​​ Module[{w = 400},​​ Graphics[​​ Table[​​ Module[{x = ix, y = iy, k, e, o, d, px, py},​​ k = x/8. - 12.5;​​ e = y/8. - 12.5;​​ o = (k^2 + e^2)/169.;​​ d = 0.5 + 5 Cos[o];​​ px = x + d*k*Sin[2 d + o + t] + e*Cos[e + t] + 100;​​ py = w - (o*135 - y/4 - d*6 Cos[3 d + 9 o + t] + 125);​​​​ {​​ Opacity[36/255],​​ GrayLevel[Clip[((d*Sin[k]*Sin[4 t + e])^2 * w)/255, {0, 1}]],​​ Point[{px, py}]​​ }​​ ],​​ {iy, 0, 199}, {ix, 0, 199}​​ ],​​ PlotRange -> {{0, w}, {0, w}},​​ Background -> GrayLevel[6/255],​​ ImageSize -> Large​​ ]​​],​​{t, 0, 2 Pi}]

    Video generation

    In[]:=
    Parallelize@AnimationVideo[​​ Module[{w = 400},​​ Graphics[​​ Table[​​ Module[{x = ix, y = iy, k, e, o, d, px, py},​​ k = x/8. - 12.5;​​ e = y/8. - 12.5;​​ o = (k^2 + e^2)/169.;​​ d = 0.5 + 5 Cos[o];​​ px = x + d*k*Sin[2 d + o + t] + e*Cos[e + t] + 100;​​ py = w - (o*135 - y/4 - d*6 Cos[3 d + 9 o + t] + 125);​​​​ {​​ Opacity[36/255],​​ GrayLevel[Clip[((d*Sin[k]*Sin[4 t + e])^2 * w)/255, {0, 1}]],​​ Point[{px, py}]​​ }​​ ],​​ {iy, 0, 199}, {ix, 0, 199}​​ ],​​ PlotRange -> {{0, w}, {0, w}},​​ Background -> GrayLevel[6/255],​​ ImageSize -> Large​​ ]​​],​​{t, 0, 2 Pi},​​RasterSize->1080,​​DefaultDuration->24];//AbsoluteTiming
    Out[]=

    CITE THIS NOTEBOOK

    Medusa gen-art: translating code between P5.JS Processing and Wolfram languages using ChatGPT o1​
    by Vitaliy Kaurov​
    Wolfram Community, STAFF PICKS, December 12, 2024
    ​https://community.wolfram.com/groups/-/m/t/3338251