September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
18
Task/Mandelbrot-set/SPL/mandelbrot-set.spl
Normal file
18
Task/Mandelbrot-set/SPL/mandelbrot-set.spl
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
w,h = #.scrsize()
|
||||
sfx = -2.5; sfy = -2*h/w; fs = 4/w
|
||||
#.aaoff()
|
||||
> y, 1...h
|
||||
> x, 1...w
|
||||
fx = sfx + x*fs; fy = sfy + y*fs
|
||||
#.drawpoint(x,y,color(fx,fy):3)
|
||||
<
|
||||
<
|
||||
color(x,y)=
|
||||
zr = x; zi = y; n = 0; maxn = 150
|
||||
> zr*zr+zi*zi<4 & n<maxn
|
||||
zrn = zr*zr-zi*zi+x; zin = 2*zr*zi+y
|
||||
zr = zrn; zi = zin; n += 1
|
||||
<
|
||||
? n=maxn, <= 0,0,0
|
||||
<= #.hsv2rgb(n/maxn*360,1,1):3
|
||||
.
|
||||
Loading…
Add table
Add a link
Reference in a new issue