11-07-2025, 03:19 PM
@2112 I have been messin with your star code and found some interesting mods
reversed direction of steps (-1) and fixed holes +1 was causing plus now the star is radiating outward.
also the doyle effect is lost when number of stars are increased to get bigger star, just turns into swirling in one direction like spiral armed galaxy.
Code: (Select All)
handle& = _NewImage(620, 630, 32)
Screen handle&
stars = 360
' comment out with stars increased the Doyle effect is no longer seen get standard swirl
stars = 1080
Dim sr(stars + 1) As Integer 'radius of stars
Dim ss(stars + 1) As Integer 'step speed of stars
Dim sd(stars + 1) As Integer 'degrees of stars
Dim sx(stars + 1) As Single 'x position of stars
Dim sy(stars + 1) As Single 'y position of stars
Dim sxf, syf As Integer 'x,y final position of stars
Dim pi As Single
pi = 360 ' 3.14159
For i = 1 To stars
ss(i) = 1 'step '<<< this creates hole in the spiral swirl
' and looks like rays are swirling inward not outward
' comment out
ss(i) = -1 'step ' this fixes the swirl holes and now going outward
sr(i) = i / 2 '100'radius
sd(i) = 360 'degrees
sx(i) = i * (360 / stars) 'x pos
sy(i) = i * (360 / stars) 'y pos
Next i
Do
Cls
For i = 1 To stars 'To 1 Step -1
If sx(i) < 360 Then sx(i) = sx(i) + ss(i) Else sx(i) = sx(i) - 360
If sy(i) < 360 Then sy(i) = sy(i) + ss(i) Else sy(i) = sy(i) - 360
'I swapped Sin and Cos and doesnt seem to make a difference!!!
sxf = Cos(pi * sx(i) / sd(i)) * (sr(i) / 1) ' COS should be assoc with x
syf = Sin(pi * sy(i) / sd(i)) * (sr(i) / 2) - (360 - i) ' SIN should be assoc with y
syf2 = Sin(pi * sy(i) / sd(i)) * (sr(i) / 1)
'Line (300 + sxf, 500 + syf)-(302 + sxf, 502 + syf), _RGB(Rnd * 200, 220, 0), BF ' TREE
' tree is nice but I am interested in Doyle Spirals
Circle (310 + sxf / 3, 315 + syf2 / 3), 1, _RGB(200, 200, 0), BF 'STAR
Next i
_Delay .01
_Display
Loop Until InKey$ = Chr$(27)
_AutoDisplay
Endreversed direction of steps (-1) and fixed holes +1 was causing plus now the star is radiating outward.
also the doyle effect is lost when number of stars are increased to get bigger star, just turns into swirling in one direction like spiral armed galaxy.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever

