Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Julia-set/Sidef/julia-set-1.sidef
Normal file
21
Task/Julia-set/Sidef/julia-set-1.sidef
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
require('Imager')
|
||||
|
||||
var (w, h) = (640, 480)
|
||||
var img = %s'Imager'.new(xsize => w, ysize => h, channels => 3)
|
||||
|
||||
var maxIter = 50
|
||||
var c = Complex(-0.388, 0.613)
|
||||
|
||||
var color = %s'Imager::Color'.new('#000000')
|
||||
|
||||
for x,y in (^w ~X ^h) {
|
||||
var i = maxIter
|
||||
var z = Complex((x - w/2) / w * 3, (y - h/2) / h * 2)
|
||||
while (z.abs < 2 && --i) {
|
||||
z = (z*z + c)
|
||||
}
|
||||
color.set(hsv => [i / maxIter * 360, 1, i])
|
||||
img.setpixel(x => x, y => y, color => color)
|
||||
}
|
||||
|
||||
img.write(file => "JuliaSet_sidef.png")
|
||||
16
Task/Julia-set/Sidef/julia-set-2.sidef
Normal file
16
Task/Julia-set/Sidef/julia-set-2.sidef
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
var (w, h) = (141, 50)
|
||||
|
||||
var maxIter = 40
|
||||
var c = Complex(-0.8, 0.156)
|
||||
|
||||
for y in ^h {
|
||||
for x in ^w {
|
||||
var i = maxIter
|
||||
var z = Complex(3 * (x - w/2) / w, 2 * (y - h/2) / h)
|
||||
while (z.abs < 2 && --i) {
|
||||
z = (z*z + c)
|
||||
}
|
||||
print (i > 0 ? ' ' : '#')
|
||||
}
|
||||
print "\n"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue