QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: _vince on July 23, 2018, 07:12:33 pm

Title: interesting plot
Post by: _vince on July 23, 2018, 07:12:33 pm
Code: QB64: [Select]
  1. deflng a-z
  2. for u=0 to 640
  3.         uu=2.8 + 1.2*u/640
  4.         for x=0 to 480
  5.                 xx = x/480
  6.                 for i=0 to 500
  7.                         xx = uu*xx*(1-xx)
  8.                 next
  9.                 pset(u,480*(1-xx))
  10.         next
  11.  
  12.  
Title: Re: interesting plot
Post by: johnno56 on July 23, 2018, 08:26:08 pm
Looks familiar... I think I saw this one on an old sdlbasic website... None the less, still impressive... Well done!

J
Title: Re: interesting plot
Post by: Ashish on July 24, 2018, 12:11:36 pm
Cool! Looks like a broken wooden bridge!
Title: Re: interesting plot
Post by: bplus on July 24, 2018, 12:18:12 pm
Looks to me like something from chaos theory back in the day when it was faddish.

Here it is!
https://science.howstuffworks.com/math-concepts/chaos-theory6.htm
Title: Re: interesting plot
Post by: FellippeHeitor on July 24, 2018, 04:31:09 pm
Interesting indeed, v.
Title: Re: interesting plot
Post by: TempodiBasic on July 29, 2018, 07:26:43 pm
Hi Vincent
fine and interesting math effect...
I'm curious and so I have expanded the experience to different height and width of screen image and using different colors to show better to my tired/jaded eyes the plot effect.

Code: QB64: [Select]
  1. DEFLNG A-Z
  2. A = 480: L = 640
  3. R = 255: G = 0: B = 0
  4.     SCREEN _NEWIMAGE(L, A, 32)
  5.  
  6.     FOR u = 0 TO L
  7.         uu = 2.8 + 1.2 * u / L
  8.         FOR x = 0 TO A
  9.             xx = x / A
  10.             FOR i = 0 TO 500
  11.                 xx = uu * xx * (1 - xx)
  12.             NEXT
  13.             PSET (u, A * (1 - xx)), _RGB(RND * R, RND * G, RND * B)
  14.         NEXT
  15.     NEXT
  16.     LOCATE 1, 1: PRINT "PRESS C FOR COLOR, SPACE FOR HEIGHT, ENTER FOR WIDTH"
  17.     DO
  18.         T = _KEYHIT
  19.     LOOP UNTIL T
  20.     IF T = 27 THEN END
  21.     IF T = 32 THEN
  22.         SELECT CASE A
  23.             CASE 320
  24.                 A = 480
  25.             CASE 480
  26.                 A = 600
  27.             CASE 600
  28.                 A = 320
  29.         END SELECT
  30.     END IF
  31.     IF T = 13 THEN
  32.         SELECT CASE L
  33.             CASE 320
  34.                 L = 640
  35.             CASE 640
  36.                 L = 800
  37.             CASE 800
  38.                 L = 320
  39.         END SELECT
  40.     END IF
  41.     IF T = 99 OR T = 67 THEN
  42.         IF (R = 255 AND B = 0 AND G = 0) THEN
  43.             R = 0
  44.             B = 255
  45.             G = 0
  46.  
  47.         ELSEIF (R = 0 AND B = 255 AND G = 0) THEN
  48.             R = 0
  49.             B = 0
  50.             G = 255
  51.  
  52.         ELSEIF (R = 0 AND B = 0 AND G = 255) THEN
  53.             R = 255
  54.             B = 0
  55.             G = 0
  56.         END IF
  57.     END IF
  58.  
Thanks to show and to share.

PS if you don't want copy paste you can download file here
Title: Re: interesting plot
Post by: johnno56 on July 29, 2018, 08:14:12 pm
Ah. Technicolor... Cool.