Video wird geladen...
Video konnte nicht geladen werden
//#つぶやきProcessing int n=999999,p[]=new int[n],i,j; float t=1; void setup(){ size(800,800); for(i=2;i<n;i++)if(p[i]==0)for(j=i+i;j<n;j+=i)p[j]=i; } void draw(){ clear(); stroke(-1); for(i=2;i<n;i++)if(p[i]==0)circle(i*sin(i*t)/99+400,i*cos(i*t)/99+400,2); t+=1e-7; }
159,925 Aufrufe • vor 2 Jahren •via X (Twitter)
9 Kommentare

ソスウノカシカを見に来た。一次元の数列を二次元でどう表現しているのかが気になったので見に来たんだけど、面白かった。素数螺旋の角度を変えると見え方が変わるというハックがあったので、動的に変わっていくようなものを早速作ってみた。あと、素数のパターンを布にするというのは面白いアイデア。

n:=99999.p:=Array new: n withAll: 0.t:=1.c:=RSCanvas new. 3to:n do:[:i|(p at: i)==0ifTrue:[(i+i to:n by: i)do:[:j | p at: j put: i]]]. c newAnimation onStepDo: [c clear. 3 to: n do:[:i|(p at:i)==0ifTrue:[c newCircle radius: 2; position: (i*t)sin@(i*t)cos*i/99]]. t:=t+1e-7. ]

Pharo?

3blue1brown posted a video of this prime number spiral explanation it’s not as cool tho

@MoriYuzan Great Work 👏👏👏👏

@MoriYuzan Oh!!! Lovely 🌹

:)!

すげー!

Love this shift. Had an old galaxy phone that could do the same thing... as a background... can't find it anyware.
Ähnliche Videos
Sensitive content
i n j e c t i t
al !
205,859 Aufrufe • vor 1 Jahr
