Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scharf Brot Fractal
#1
Code:
set window "Scharf Brot Fractal", 1280, 700, false
set redraw off

randomize clock()

w = width(primary)
h = height(primary)
zoom = 4 / w ' 4 / w ' if too wide
dmin = 0.06

set color 0, 0, 32
cls

for a = 0 to w - 1
    for b = 0 to 1.5 * h
        x = (a - w) * zoom
        y = (b - h) * zoom
        i = 0
        d = 100
        do
            u= x * x
            v = y * y
            if u + v > 4.8 or i > 30 or d < dmin then
                break
            endif
            t = u - v
            y = 2 * x * y + 0.156
            x = t - 0.8
            i = i + 1
            n = abs(u + v - 1)
            if n < d then
                d = n
            endif
        loop
        if d < dmin then
            colour = 255 - int(4000 * d)
            if colour < 0 then
                colour = 255
            endif
            x1 = a - w / 2
            y1 = b - h / 2
            x2 = w + w / 2 - 1 - a
            y2 = h + h / 2 - b
            set color 0, colour, colour ' original (colour, colour, 0) - yellow
            draw line x1, y1, x1 + 1, y1 + 1
            draw line x2, y2, x2 + 1, y2 + 1
        endif
    next
    redraw
    fwait 60
next

set color 255, 255, 255
set caret 100, 100
wln "ESQ to quit..."
redraw

do
    fwait 60
until keydown(KEY_ESCAPE, true)

for fade = 0 to 255
    set color 0, 0, 32, fade
    draw rect 0, 0, width(primary), height(primary), true
    redraw
    fwait 60
next

Be patient... Takes about 15 seconds (or so) to display...

Modify the color to your liking (line #44?)

This is NOT my program... (not 'that' clever... lol) It is a program that was referred to myself that was found on the QB64pe forum. Figured I would modify for N7.

The ESC key and fade routines were just 'thrown' together. They work, but I feel that it could be done better...

Fractals are brilliant! Another method to "paint by numbers"...

Enjoy!
Logic is the beginning of wisdom.
Reply
#2
I may be mistaken, but I believe you shared this beautiful fractal once before.
It's wonderful to see it again - thank you for bringing this masterpiece back to our attention.

Big Grin
Reply
#3
oh... I had a sneaking feeling that I may have but wasn't sure... I really must get on top of all the stuff I work on... I suppose it may be a combination of too many unfinished projects; Forgetting if I had submitted a similar project; Forgetting to check the forum projects before submitting; or perhaps getting to an age of just forgetting... *sigh*

But no... I do not believe that you are mistaken... The fault is mine, whether accidental or not... I will try to do better... Thank you for letting me know, George...
Logic is the beginning of wisdom.
Reply
#4
(11-04-2025, 11:18 AM)johnno56 Wrote: oh... I had a sneaking feeling that I may have but wasn't sure... I really must get on top of all the stuff I work on... I suppose it may be a combination of too many unfinished projects; Forgetting if I had submitted a similar project; Forgetting to check the forum projects before submitting; or perhaps getting to an age of just forgetting... *sigh*

But no... I do not believe that you are mistaken... The fault is mine, whether accidental or not... I will try to do better... Thank you for letting me know, George...

G'day ! No worries, your fractal repost's still got me scratching me head.
Time for a cuppa ! - have a ripper day !
But hey, how'd you suss my real name's George ? lol ....lol.... *peace*

Big Grin
Reply
#5
Very beautiful Johnno....thank you.
Reply
#6
... umm... Thank you... but it's not mine... merely the messenger... lol
Logic is the beginning of wisdom.
Reply
#7
It may not have been yours Johnno, but it's been very well translated into N7 by you. I know how difficult it can be sometimes when I try to move code from one language to another......it seems to get more difficult each time, as I am of an age where I seem to forget 2 things for every 1 that I remember Smile
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)