' based on ron77's FreeBasic program found at https://retrocoders.phatcode.net/index.php?topic=444.0;topicseen
' BASIC Anywhere Machine version by Charlie Veniot
Dim As Double x, y, angle, S
 
screen _newimage( 800, 600, 27)
line(0,0)-(800,600),_rgb(0,64,128),bf
 
for S = (16*255)/256 to 0 step -1/32
  For angle = 0 To 3.1415 Step 1/256
      
      x = 16 * (Sin(angle))^3
      y = 13 * Cos(angle) - 5 * Cos(2 * angle) - 2 * Cos(3 * angle) - Cos(4 * angle)
      x = S * x : y = S * y
      
      var iX = cint(int(x)), iY=cint(int(y))        
      var fX = x-iX, fY = y-iY        
      
      'dim as long iG=sqr(x*x+y*y)*.1,iR=128+S*8,iB=64-S*4
      dim as long iR=abs(X\2)+128,iB=16+angle*64,iG=abs(Y)*.9
      const iAlpha = 128
      
      pset ((400+iX)  , (300-iY)  ), _RGB(iR, iG, iB) 
      pset ((400+iX)+1, (300-iY)  ), _RGB(iR, iG, iB) 
      pset ((400+iX)  , (300-iY)-1), _RGB(iR, iG, iB) 
      pset ((400+iX)+1, (300-iY)-1), _RGB(iR, iG, iB)
      
      pset ((400-iX)  , (300-iY)  ), _RGB(iR, iG, iB) 
      pset ((400-iX)-1, (300-iY)  ), _RGB(iR, iG, iB) 
      pset ((400-iX)  , (300-iY)-1), _RGB(iR, iG, iB) 
      pset ((400-iX)-1, (300-iY)-1), _RGB(iR, iG, iB)
          
  Next angle
  _delay 0.0125
next S