You should use "lock pixels" and "unlock pixels".
It way faster with that, though it still gets terribly slow when the nebula gets bigger.
REM Project: rotation
REM Created: 9/28/2007 5:47:55 PM
REM
REM ***** Main Source File *****
REM
squaresizex = 10
squaresizey = 10
Randomize Timer()
Sync on
angle as float
Restart:
squaresizex = squaresizex + 2
squaresizey = squaresizey + 2
Dim squa(squaresizex-1,squaresizey-1) as integer
Dim ang(squaresizex-1,squaresizey-1) as float
Dim dist(squaresizex-1,squaresizey-1) as float
For x = 0 to squaresizex-1
For y = 0 to squaresizey-1
halfsizex = squaresizex/2
halfsizey = squaresizey/2
squa(x,y) = RGB(255,255,255)
ang(x,y) = atanfull(x-halfsizex,y-halfsizey)
dist(x,y) = y/sin(ang(x,y))
Next y
Next x
cls
angle = angle + 0.5
lock pixels
For x = 0 to squaresizex-1
For y = 0 to squaresizey-1
Dot (sin(ang(x,y)+angle)*dist(x,y))+300,(cos(ang(x,y)+angle)*dist(x,y))+350,squa(x,y)
Next y
Next x
unlock pixels
Sync
Goto Restart