Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Schraf Brot Fractal
#9
Here is a swirl, also by Schraf. I got it from the FaceBook group "BASIC Programming Language". I did have to fix it for QB64pe because he was using color as a variable instead of the command color. 



[Image: Swirl-by-Schraf.jpg]


Code: (Select All)

'Posted on FaceBook's "BASIC Programming Language" group by Eric Schraf
'Edited by SierraKen

Screen _NewImage(1280, 960, 32)
Const pi = 3.1415926
Dim screenX, screenY As Integer
Randomize Timer
np = 800: n = 180: m = 30: k = .02
For i = 0 To n
    x = Rnd: y = Rnd
    For j = 0 To m
        x_pixel = Int(np * x): y_pixel = Int(np * y)
        screenX = x_pixel + (1280 - np) / 2
        screenY = y_pixel
        If j > 0 Then
            col = prevX * prevX + prevY * prevY
            rr = 4 * (col Mod 256)
            gg = col Mod 256
            bb = (255 - col \ 2) Mod 256
            Line (prevX, prevY)-(screenX, screenY), _RGB(rr, gg, bb)
        End If
        prevX = screenX: prevY = screenY
        xx = 2 * x - 1: yy = 2 * y - 1
        If xx <> 0 Then an = Atn(yy / xx) Else an = pi / 2 * Sgn(yy)
        If xx < 0 Then an = an + pi * Sgn(yy)
        an = an + 4 * pi / 3 + Sin(6 * pi * Sqr(xx * xx + yy * yy)) / 4
        x = x + k * Cos(an): y = y + k * Sin(an)
        If x <= 0 Or x >= 1 Or y <= 0 Or y >= 1 Then Exit For
    Next j
Next i
Sleep
End
Reply


Messages In This Thread
Schraf Brot Fractal - by bplus - 06-05-2025, 11:12 PM
RE: Schraf Brot Fractal - by Jack - 06-05-2025, 11:49 PM
RE: Schraf Brot Fractal - by madscijr - 06-06-2025, 02:12 AM
RE: Schraf Brot Fractal - by SierraKen - 06-06-2025, 04:21 AM
RE: Schraf Brot Fractal - by Jack - 06-06-2025, 12:23 PM
RE: Schraf Brot Fractal - by Jack - 06-06-2025, 12:36 PM
RE: Schraf Brot Fractal - by CharlieJV - 06-06-2025, 01:14 PM
RE: Schraf Brot Fractal - by euklides - 06-08-2025, 07:20 AM
RE: Schraf Brot Fractal - by SierraKen - 06-10-2025, 03:51 PM
RE: Schraf Brot Fractal - by SierraKen - 06-10-2025, 04:07 PM
RE: Schraf Brot Fractal - by PhilOfPerth - 06-10-2025, 10:15 PM
RE: Schraf Brot Fractal - by SierraKen - 06-11-2025, 06:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pseudo-fractal - interactive version hsiangch_ong 3 886 02-06-2025, 09:20 AM
Last Post: SMcNeill
  Fractal Explorer vince 4 1,349 10-16-2024, 09:08 PM
Last Post: Trial And Terror
  Playing with dragon curve fractal Dav 11 2,483 10-09-2023, 12:23 AM
Last Post: Dav

Forum Jump:


Users browsing this thread: 1 Guest(s)