+1 @Dav another nice surprise!
Here is my code for 2nd snapshot of so called "Doyle" spiral.
Turns out this might not exactly fit the definition of Doyle spirals which is math model of plant growth discovered (or is it invented with math its hard to say) in ealy 1900's. It is circle packing 6 tangent circles around a center and infinitely expanding outward with logarithmic sequence of circle centers. I can not prove perfectly tangent nor perfectly logarithmic but I can say it looks pretty cool anyway! IMHO
I am offerring up code I had started this Challenge with because I think we've come up with more interesting Challenge -
Quite a bit! Suddenly I am reminded once again of Mennonites "SineCube" another great example from QB Samples I mentioned recently in another post.
Here is my code for 2nd snapshot of so called "Doyle" spiral.
Code: (Select All)
_Title "Doyle Spirals 2" ' as B+ ported from John T at LB 2025-11-04
Screen _NewImage(700, 700, 32)
_ScreenMove 300, 0
Color , _RGB32(128)
Cls
xc = 350: yc = 350
For angle = 0 To 359 Step 5
radius = .1
While radius < 340
If angle Mod 10 = 0 Then
x = radius * Cos(_D2R(angle)) ' Calculate X position
y = radius * Sin(_D2R(angle)) ' Calculate Y position
clr~& = _RGB32(55 + radius * 200 / 340, 0, 0)
Else
x = (radius * 1.05 * Cos(_D2R(angle))) ' Calculate X position
y = (radius * 1.05 * Sin(_D2R(angle))) ' Calculate Y position
clr~& = _RGB32(0, 0, 255 - radius * 240 / 340)
End If
FC3 xc + x, yc + y, Int(radius * .052) - 2, clr~&
radius = radius * 1.1
Wend
Next
angle = 0
restart:
radius = .1
clr~& = _RGB32(255, 255, 0)
While radius < 340
r = Int(radius * .052) - 5
If r < 1 Then r = 1
x = radius * Cos(_D2R(angle)) ' Calculate X position
y = radius * Sin(_D2R(angle)) ' Calculate Y position
FC3 xc + x, yc + y, r, clr~&
x = (radius * 1.05 * Cos(_D2R(angle + 5))) ' Calculate X position
y = (radius * 1.05 * Sin(_D2R(angle + 5))) ' Calculate Y position
FC3 xc + x, yc + y, r, clr~&
angle = angle + 10
radius = radius * 1.1
Wend
l = l + 1
angle = 0
angle = angle + l * 60
If l < 6 Then GoTo restart
angle = 0: l = 0
restart2:
radius = .1
clr~& = _RGB32(0, 255, 192)
While radius < 340
r = Int(radius * .052) - 8
If r < 1 Then r = 1
x = radius * Cos(_D2R(angle)) ' Calculate X position
y = radius * Sin(_D2R(angle)) ' Calculate Y position
FC3 xc + x, yc + y, r, clr~&
x = (radius * 1.05 * Cos(_D2R(angle - 5))) ' Calculate X position
y = (radius * 1.05 * Sin(_D2R(angle - 5))) ' Calculate Y position
FC3 xc + x, yc + y, r, clr~&
angle = angle - 10
radius = radius * 1.1
Wend
l = l + 1
angle = 0
angle = angle - l * 60
If l < 6 Then GoTo restart2
Sleep
Sub FC3 (cx As Long, cy As Long, r As Long, clr~&)
Dim As Long r2, x, y ' for Option _Explicit
If r < 1 Then Exit Sub
Line (cx - r, cy)-(cx + r, cy), clr~&, BF
r2 = r * r
Do
y = y + 1
x = Sqr(r2 - y * y)
Line (cx - x, cy + y)-(cx + x, cy + y), clr~&, BF
Line (cx - x, cy - y)-(cx + x, cy - y), clr~&, BF
Loop Until y = r
End SubTurns out this might not exactly fit the definition of Doyle spirals which is math model of plant growth discovered (or is it invented with math its hard to say) in ealy 1900's. It is circle packing 6 tangent circles around a center and infinitely expanding outward with logarithmic sequence of circle centers. I can not prove perfectly tangent nor perfectly logarithmic but I can say it looks pretty cool anyway! IMHO
I am offerring up code I had started this Challenge with because I think we've come up with more interesting Challenge -
What can you do with Sin and Cos?
Quite a bit! Suddenly I am reminded once again of Mennonites "SineCube" another great example from QB Samples I mentioned recently in another post.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever

