Original artwork

◼
  • Original tweet JS processing P5.JS code: https://x.com/yuruyurau/status/2052410599662072049
  • ◼
  • By artist @yuruyurau https://x.com/yuruyurau
  • a=(x,y,d=mag(k=4*cos(x/21),e=y/8-20))=>circle((q=3*sin(k*2)+.3/k+sin(y/19)*k*(9+2*sin(e*14-d*3+t*2)))+50*cos(c=d-t)+200,q*sin(c)+d*39-475,k*k>15?2:1)
    t=0,draw=$=>{t||createCanvas(w=400,w);background(9).noStroke().fill(w,116);for(t+=PI/240,i=1e4;i--;)a(i,i/235)}

    Wolfram interactive interface / app

    Interpreted translation into Wolfram Language with added red color at the hair tips:
    ClearAll["`*"];​​x = N@Range[0, 9999]; ​​y = x/235;​​k = 4 Cos[x/21];​​​​tipsMask = Thread[k^2 > 15];​​baseMask = Thread[k^2 <= 15];​​​​pts[t_] := Module[{e, d, c, q},​​ e = y/8 - 20.;​​ d = Sqrt[k^2 + e^2];​​ c = d - t;​​ q = 3 Sin[2 k] + 0.3/k + Sin[y/19] k (9 + 2 Sin[14 e - 3 d + 2 t]);​​ Transpose @ {q + 50 Cos[c] + 200, 400 - (q Sin[c] + 39 d - 475)}​​];​​​​Manipulate[​​ DynamicModule[{currentPts = pts[t]},​​ Graphics[​​ {Blend[{White,Red},Sin[t]^2], Opacity[.5], ​​ PointSize[.01], Point[Pick[currentPts, tipsMask]],​​ White, Opacity[.75], ​​ PointSize[.0025], Point[Pick[currentPts, baseMask]]},​​ PlotRange{{100,300},{75,320}},BackgroundBlack,ImageSize550​​ ]​​ ],​​ {t, 0, 2 Pi, Appearance -> "Labeled"},​​ SaveDefinitions -> True​​]
    Out[]=
    ​
    t
    5.37841

    Wolfram animated GiF

    We offset the animation with a different phase shift of periodic motion:
    delta=Pi/3;
    so the end segment for slow motion lands well on the lighting the red hair tips:
    shift=Pi/2;
    Segment 1 of regular fast motion:
    frm1=ParallelTable[​​DynamicModule[{currentPts=pts[t]},​​Graphics[​​{Blend[{White,Red},Sin[t]^2],Opacity[.5],​​PointSize[.01],Point[Pick[currentPts,tipsMask]],​​White,Opacity[.75],​​PointSize[.0025],Point[Pick[currentPts,baseMask]]},​​PlotRange{{100,300},{75,320}},BackgroundBlack,ImageSize550​​]​​],​​{t,0+shift,2Pi-delta+shift,Pi/50}​​];
    Segment 2 of slowed motion (more frequent frames at smaller time increments):
    frm2=ParallelTable[​​DynamicModule[{currentPts=pts[t]},​​Graphics[​​{Blend[{White,Red},Sin[t]^2],Opacity[.5],​​PointSize[.01],Point[Pick[currentPts,tipsMask]],​​White,Opacity[.75],​​PointSize[.0025],Point[Pick[currentPts,baseMask]]},​​PlotRange{{100,300},{75,320}},BackgroundBlack,ImageSize550​​]​​],​​{t,2Pi-delta+shift,2Pi+shift,Pi/270}​​];
    Total number of frames:
    In[]:=
    Join[frm1,frm2]//Length
    Out[]=
    175
    Generate GiF:
    Export["critter.gif",Join[frm1,frm2],ImageSize->550,"DisplayDurations"->.03]

    CITE THIS NOTEBOOK

    Red hair tips electric eel in fast and slow motion: translating from P5.JS processing to Wolfram​
    by Vitaliy Kaurov​
    Wolfram Community, STAFF PICKS, May 8, 2026
    ​https://community.wolfram.com/groups/-/m/t/3713047