_TITLE "Sierpinski Circled by bplus" '2018-07-23 update some code tweaks learned when translating this to other BASIC flavors
'for new ORG avatar?
cx
= xmax
/ 2: cy
= ymax
/ 2: cr
= ymax
/ 6: inc
= _PI(1 / 360) a = 0
levels = 12 - n
RecurringCircles cx, cy, cr, n, a, levels
a = a + inc
RecurringCircles cx, cy, cr, n, 0, levels
SUB RecurringCircles
(x
, y
, r
, n
, rao
, level
) fcirc x, y, r
x1
= x
+ 1.5 * r
* COS(i
* ra
+ rao
+ _PI(-.5)) y1
= y
+ 1.5 * r
* SIN(i
* ra
+ rao
+ _PI(-.5)) RecurringCircles x1, y1, r * .5, n, 2 * rao, level - 1
'Steve McNeil's copied from his forum note: Radius is too common a name
RadiusError = -subRadius
X = subRadius
Y = 0
' Draw the middle span here so we don't draw it twice in the main loop,
' which would be a problem with blending turned on.
LINE (CX
- X
, CY
)-(CX
+ X
, CY
), , BF
RadiusError = RadiusError + Y * 2 + 1
LINE (CX
- Y
, CY
- X
)-(CX
+ Y
, CY
- X
), , BF
LINE (CX
- Y
, CY
+ X
)-(CX
+ Y
, CY
+ X
), , BF
X = X - 1
RadiusError = RadiusError - X * 2
Y = Y + 1
LINE (CX
- X
, CY
- Y
)-(CX
+ X
, CY
- Y
), , BF
LINE (CX
- X
, CY
+ Y
)-(CX
+ X
, CY
+ Y
), , BF