Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
55
Task/Julia-set/FreeBASIC/julia-set.basic
Normal file
55
Task/Julia-set/FreeBASIC/julia-set.basic
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#define pix 1./120
|
||||
#define zero_x 320
|
||||
#define zero_y 240
|
||||
#define maxiter 250
|
||||
|
||||
type complex
|
||||
r as double
|
||||
i as double
|
||||
end type
|
||||
|
||||
operator + (x as complex, y as complex) as complex
|
||||
dim as complex ret
|
||||
ret.r = x.r + y.r
|
||||
ret.i = x.i + y.i
|
||||
return ret
|
||||
end operator
|
||||
|
||||
operator * (x as complex, y as complex) as complex
|
||||
dim as complex ret
|
||||
ret.r = x.r*y.r - x.i*y.i
|
||||
ret.i = x.r*y.i + x.i*y.r
|
||||
return ret
|
||||
end operator
|
||||
|
||||
operator abs ( x as complex ) as double
|
||||
return sqr(x.r*x.r + x.i*x.i)
|
||||
end operator
|
||||
|
||||
dim as complex c, z
|
||||
dim as integer x, y, iter
|
||||
|
||||
input "Real part of c? ", c.r
|
||||
input "Imaginary part of c? ", c.i
|
||||
|
||||
screen 12
|
||||
|
||||
for x=0 to 639
|
||||
for y=0 to 479
|
||||
z.r = (x-zero_x)*pix
|
||||
z.i = (y-zero_y)*pix
|
||||
for iter=0 to maxiter
|
||||
z = z*z + c
|
||||
if abs(z)>2 then
|
||||
pset(x,y),iter mod 16
|
||||
goto cont
|
||||
end if
|
||||
next iter
|
||||
pset(x,y),1
|
||||
cont:
|
||||
next y
|
||||
next x
|
||||
|
||||
while inkey=""
|
||||
wend
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue