uses gdip

Screen 600,600,1
SetCaption "ATOMIC CURVE"
SYS fo= LoadFont ("arial",36)

sys i,q,a,aa,ab,su,cr1,cg1,cb1,cr2,cg2,cb2,g2
single angle

Function WrapAngle(single r) as single 
While r < -pi 
  r = r + 2*pi 
Wend 
While r > pi 
  r = r - 2*pi 
Wend     
Return r
End Function

While Key(27)=0
angle=WrapAngle(angle+2)
aa = aa +1
ab = ab +su
iF ab >200 Then su =-2
iF ab <= 0 Then su =2
ClsColor 45,255,255,255
Text fo,80,16,"SIMPLE MATHEMATICS", ARGB 100,255,0,0
For i=0 To 3
  cr1=128+127*cos(aa/2*pi/128+aa/2*90/74) 
  cb1=128-127*cos(aa/2*pi/128+aa/2*90/81)
  FillOval(300+cos(angle+i*90)*ab-ab/4,300-sin(angle+i*90)*ab-ab/4,ab/2,ab/2, ARGB 55,cr1,cg1,cb1)
  For a=1 To 2
    cr2=128+127*cos(aa*pi/128+aa*90/74)
    g2=128+127*sin(aa*pi/128+aa*90/63)
    cb2=128-127*cos(aa*pi/128+aa*90/81)
    For q=1 To 20
    FillOval(300+cos(angle+i*90)*ab+cos(a*180-angle+(q*4))*(ab/6)-((ab/10-q)/2),300-sin(angle+i*90)*ab-sin(a*180-angle+(q*4))*(ab/6)-((ab/10-q)/2),ab/10-q,ab/10-q, ARGB 55,cr2,cg2,cb2)
    Next 
  Next 
Next 
Flip
SetFps 24
Wend 
Ends