Post by B+ on Jan 25, 2021 21:56:12 GMT
Crop Circles are 2 Color Geometric, Fractal, Intelligent and/or Fun Designs
'Crop Circles #3 'b+ trans and mod to QB64 2021-01-25 to JB also
global XMAX, YMAX, CX, CY, LC$, HC$, D2R
H$ = "gr"
XMAX = 730 '< actual drawing space needed
YMAX = 730 '< actual drawing space needed
CX = XMAX / 2: CY = YMAX / 2 'screen center
HC$ = "240 220 80" 'Crop Circles are 2 Color Geometric, Fractal, Intelligent and/or Fun Designs
LC$ = "100 50 10"
D2R = 3.14159265/180 'converting Degrees to Radians
nomainwin
WindowWidth = XMAX + 8
WindowHeight = YMAX + 32
UpperLeftX = 300
UpperLeftY = 40
open "Crop Circles #3 Mod" for graphics_nsb_nf as #gr
#gr "trapclose quit"
#gr "down"
#gr "fill ";HC$ ' the field
n = 12: stp = -40
#gr "COLOR "; HC$ 'outline circles in field color
FOR br = 360 TO 1 STEP stp
shft = shft + 720 / (n * n)
FOR i = 1 TO n
x = CX + br * COS(D2R * (i * 360 / n + shft))
y = CY + br * SIN(D2R * (i * 360 / n + shft))
call drawc x, y
call pause 60
NEXT
NEXT
wait
sub quit Hdl$
close #Hdl$
end
end sub
SUB drawc mx, my
cr = .5 * SQR((CX - mx) ^ 2 + (CY - my) ^ 2): m = int(.5 * cr)
dx = (mx - CX) / m: dy = (my - CY) / m: dr = cr / m
FOR i = m TO 0 STEP -1
IF i MOD 2 = 0 THEN
#gr "Backcolor ";HC$
ELSE
#gr "Backcolor ";LC$
end if
x = CX + dx * (m - i): y = CY + dy * (m - i): r = dr * i
#gr "place ";x;" ";y;"; circlefilled ";r
NEXT
END SUB
sub pause mil 'tsh version has scan built-in
t0 = time$("ms")
while time$("ms") < t0 + mil : scan : wend
end sub