t=0;w=255;V=1.4*w// #p5js
draw=_=>{t++||createCanvas(2*w,2*w)+noStroke()
for(R=V;Q=2*R,R>0;R-=10){
fill(Q&w,(Q+85)&w,(Q+170)&w)
beginShape()
for(k=0;r=R+20*sin(7*k),k<TAU;k+=PI/50)
vertex(w+r*cos(K=k+2*(R-V/2)*sin(t/1e4)),w+r*sin(K))
endShape()}}
t=0;B=255// #p5js
draw=_=>{t++||createCanvas(W=600,300)+textSize(B)+pixelDensity(1)+noStroke()
background(fill(1));text("p5⁎js",0,210);loadPixels()
for(y=33;Y=y*9,y--;)for(x=66;X=x*9,x--;)
l=pixels[4*(W*Y+X)]?(fill((c=(X^Y)+t)&B,(2*c)&B,(3*c)&B),rect(X,Y,2+(c/6)%7)):0}
p5⁎js Squaring Up
view/run this code online:
editor.p5js.org/KMoerman/ske…
t=0;b=255;a=4// #p5js
draw=_=>{t||createCanvas(W=2*b,W)+noStroke()+fill(0,b,0)
background(0,t?50:b)
r=d=.5;a=3.8+.2*sin(T=t++/b);A=3.8+.2*sin(T+2)
for(k=3e3;k--;){r=a*r*(1-r);d=A*d*(1-d)
x=(R=b*r)*cos(D=PI*d-t/90+r*3);y=R*sin(D)
rect(b+x,b+y,1);rect(b-x,b-y,1)}}
Logistic Eye
view/run this code online:
editor.p5js.org/KMoerman/ske…
t=0;w=255
draw=_=>{t++||(createCanvas(W=2*w,W),noStroke(),r=random)
background(randomSeed(1))
for(n=1e4;n--;){d=log(r()+6e-5);a=TAU*r();u=42*d*sin(a);v=35*d*cos(a)
c=cos(D=3*d+t/60);s=sin(D);x=u*c+v*s;y=-u*s+v*c+r()*14
X=1.4*x+.6*y;Y=.2*x+.8*y;fill(w,w+130*d,0);rect(w+X,w+Y,2)}}
t=T=0;B=255;w=300// #GumowskiMira #p5js
f=x=>a*x+2*(1-a)*x*x/(1+x*x)**2
draw=_=>{t++||createCanvas(W=2*w,W)+noStroke()
background(0,T?8:B);x=y=4+4*sin(t/20);a=-.7-sin(t/70)/99
for(m=10;fill(T%B,(w+T)%B,(W+T++)%B),m--;)
for(k=1e3;k--;){x=y+f(u=x);y=f(x)-u;rect(w+y*17,w+x*17,2)}}
Gumowski Mira attractor with modulated parameter and initial conditions
View/run this code online:
editor.p5js.org/KMoerman/ske…
t=T=0;B=255;w=300;a=4;b=6;c=2;x=.7;y=-.3//Hopalong Fractal #p5js
draw=_=>{t++||createCanvas(W=2*w,W)+background(0)+noStroke()
for(m=10;fill(T%B,(3*T)&B,(5*T++)&B),m--;)
for(k=3e3;k--;){[x,y]=[y-1-sqrt(abs(b*x-1-c))*Math.sign(x-1),a-x-1];
rect(X=w+x,Y=w+y,1)}}
Kurt Moerman retweeted
A bestiary of chaotic attractors, each carrying its own dihedral Dₙ symmetry.
Every disk holds a different attractor of the generalized Field–Golubitsky map:
z ↦ {a₀ + a₁|z|² + a₂ Re(zⁿ) + a₃|z| Re[(z/|z|)ⁿᵖ]} z + a₄ z̄ⁿ⁻¹
#builtWithMarimo
t=0;h=.01;f=210
draw=_=>{t++||createCanvas(W=800,W,WEBGL)+noStroke()
rotate(t/30,[0,x=y=z=1,0]);background(0)
for(k=1e4;k--;){[x,y,z]=[x+((z-.7)*x-3.5*y)*h,y+(3.5*x+(z-.7)*y)*h,z+(.6+.95*z-z**3/3-(x*x+y*y)*(1+.25*z)+.1*z*x**3)*h];
push();translate(f*x,f*z-90,f*y);pop(box(2))}}
view the code online, it runs very slowly online, best is to run it locally in your browser using a html file which calls the p5 library and this code;
editor.p5js.org/KMoerman/ske…
f=0;r=240;s=.7*r;b=255// #p5js
draw=_=>{f||createCanvas(W=2*b,W)+noStroke()
background(0,f?8:b);d=.39*cos(f++/W)
for(u=0;q=sin(u),p=cos(u),fill(m=b-p*b,c=b-q*b,b+c-m),u<TAU;u+=.4-d)
for(v=u;j=sin(v+u),k=cos(v+u),v<u+TAU;v+=.4+d)
rect(b+r*q*k,b+s*q*j+s*p,2+q*j)}
Kurt Moerman retweeted
#つぶやきProcessing 「迷宮案内の章」
f=0
draw=_=>{
f++||createCanvas(W=500,W)
background(0)
noStroke()
for(x=0;x<=W;x+=20){
for(y=0;y<=W;y+=20){
for(n=0;n<20;n++){
r=$=>max(-10,min(10,20*$((n+f)*noise(x,y)/9)))
circle(x+r(cos),y+r(sin),3)
}}}
}
f=0;B=255;N=20;s=12;w=s*N// #p5js
g=x=>s*sin(5*x)
draw=_=>{f++||(createCanvas(W=2*w,W),r=rect);background(0)
for(m=N;m--;)for(k=N;k--;)
{q=f/W+(k^m)/55;fill(c=(q*B)&B,(2*c)&B,B-c)
r(x=m*s,y=k*s,V=g(q-f/w),H=g(q+f/B))
r(x,Y=W-y-s,V,H);r(X=W-x-s,y,V,H);r(X,Y,V,H)}}




