Post by bluatigro on May 1, 2018 12:55:00 GMT
this is a translation of a old program in QB4.5
that i found in a old magazine
i want to know :
are there more recepy's that give nice output
i think they are out there
experiment whit recepy's and report good one's
i have no idea how many recepy's there are
that i found in a old magazine
i want to know :
are there more recepy's that give nice output
i think they are out there
experiment whit recepy's and report good one's
i have no idea how many recepy's there are
WindowWidth = DisplayWidth
WindowHeight = DisplayHeight
global winx , winy
'' bluatigro 1 may 2018
'' QB4.5 code from 1989
'' translation to JB
winx = WindowWidth
winy = WindowHeight
global pi , golden.ratio
pi = atn( 1 ) * 4
golden.ratio = ( sqr( 5 ) - 1 ) / 2
nomainwin
angle = 360 * golden.ratio
factor = golden.ratio
angle$ = str$( angle )
factor$ = str$( factor )
prompt "angle [ 0 ... 360 ] = " ; angle$
prompt "factor [ 0 ... 1 ] = " ; factor$
angle = val( angle$ )
factor = val( factor$ )
open "fractel from 1989" for graphics as #m
#m "trapclose [quit]"
#m "fill black"
x = rnd(0) * winy - winy / 2
y = rnd(0) * winy - winy / 2
#m "size 1"
#m "color green"
while tel < 10000
tel = tel + 1
ex = winx / 2 + x
ey = winy / 2 + y
#m "goto " ; ex ; " " ; ey
#m "down"
#m "set " ; ex ; " " ; ey
#m "up"
''this is the recepy from 1989 there may be other's
''feel free to experiment whit this and report good recepy's
if rnd(0) < .1 then
call scale x , y , 1 / 2
call translate x , y , winy / 4 , winy / 4
else
call rotate x , y , angle
call scale x , y , factor
end if
''end resepy
wend
notice "Ready !!"
wait
[quit]
close #m
end
function rad( deg )
rad = deg * pi / 180
end function
sub rotate byref k , byref l , deg
s = sin( rad( deg ) )
c = cos( rad( deg ) )
hk = k * c - l * s
hl = k * s + l * c
k = hk
l = hl
end sub
sub scale byref x , byref y , f
x = x * f
y = y * f
end sub
sub translate byref x , byref y , dx , dy
x = x + dx
y = y + dy
end sub
function length( x , y )
length = sqr( x * x + y * y )
end function