Author Topic: Cardioid and Beyond  (Read 3009 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Cardioid and Beyond
« on: August 18, 2020, 04:08:36 pm »
This file disappeared from here so here it is again, because Ken's present work reminds me of it:
Code: QB64: [Select]
  1. _TITLE "Cardioid and Beyond" 'B+ 2019-02-17
  2. CONST xmax = 700
  3. CONST ymax = 700
  4. CONST npoints = 200
  5. SCREEN _NEWIMAGE(xmax, ymax, 32)
  6. DIM SHARED pR, pG, pB, cN
  7. CX = xmax / 2
  8. CY = ymax / 2
  9. DA = _PI(2 / npoints)
  10. R = CX - 10
  11.  
  12. FOR Mult = 0 TO 100 STEP .01
  13.     CLS
  14.     COLOR &HFFFFFFFF
  15.     PRINT "Multiple: ";
  16.     PRINT USING "###.##"; Mult
  17.     IF Mult = INT(Mult) THEN resetPlasma
  18.     CIRCLE (CX, CY), R, _RGB32(0, 128, 0)
  19.     FOR i = 1 TO 200
  20.         x1 = CX + R * COS(i * DA)
  21.         y1 = CY + R * SIN(i * DA)
  22.         x2 = CX + R * COS(Mult * i * DA)
  23.         y2 = CY + R * SIN(Mult * i * DA)
  24.         changePlasma
  25.         LINE (x1, y1)-(x2, y2)
  26.     NEXT
  27.     _DISPLAY
  28.     _LIMIT 30
  29.  
  30. SUB changePlasma ()
  31.     cN = cN + 1
  32.     COLOR _RGB(127 + 127 * SIN(pR * cN), 127 + 127 * SIN(pG * cN), 127 + 127 * SIN(pB * cN))
  33.  
  34. SUB resetPlasma ()
  35.     pR = RND ^ 2: pG = RND ^ 2: pB = RND ^ 2
  36.  
  37.  
  38.  

Probably was in one of [banned user] threads that got removed.

 
Cardioid and Beyond.PNG
« Last Edit: August 18, 2020, 04:17:29 pm by bplus »

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Cardioid and Beyond
« Reply #1 on: August 18, 2020, 04:22:10 pm »
WOW That's just INCREDIBLE Bplus. I had a feeling someone could make something better and of course it was you. :) I've never seen this before, thanks for showing me.