Page 1 of 1
Julia set.
Posted: Sat Sep 01, 2018 5:14 pm
by JenniferDigital
I keep on seeing people running Mandlebrot sets on their homebrew computers, but I don't see many other fractals being run so... Here's my Julia set. I'm sure the brains trust could geatly improve it.
Anyway, here's the (Not very clever) code to generate it, including a little boilerplate for my machine to not mess up the terminal window with.
Code: Select all
1 zoom = 35
5 BITCLR $5E0,0: PRINT CHR$(12); : REM Serial out off, and clear screen.
10 creal=-0.8
20 cimag=0.156
30 FOR v=-48 TO 48
40 FOR h=-78 TO 78
50 x=h/(zoom*2)
60 y=v/zoom
70 FOR i=1 TO 50
80 zreal=x*x-y*y+creal
90 zimag=x*y*2+cimag
100 IF zreal*zreal>1000 THEN GOTO 150
110 x=zreal
120 y=zimag
130 NEXT i
140 px=h+79: py=v+49: GOSUB 4000
150 NEXT h
160 NEXT v
165 BITSET $5E0,0 : REM Serial out on again.
170 END
3997 :
3998 REM Plot
3999 :
4000 PRINT CHR$(5);CHR$(px);CHR$(py);
4010 RETURN
I wonder what else is out there, maybe a strange attractor?
Re: Julia set.
Posted: Sat Sep 01, 2018 5:38 pm
by BigEd
Looks nice!
Is that CHR$(5) plot routine something you've added to EhBasic? Or is there perhaps a VDU driver component to your system? Does it have more capabilities?
(I had a quick look in
your Tower of Eight repo but didn't find an answer.)
Re: Julia set.
Posted: Sat Sep 01, 2018 5:47 pm
by JenniferDigital
Since the video-card my ToE is running at the moment is based on Grant Searles code, which is itself a derivative, it comes from there. Basically, I've got a set of bits that determine where output gets forwarded to. I plan to add some extra software to draw lines and circles to the OS too. I didn't put Grant's code in my repo because he's not replied to my request to do so. There are other graphics cards I could be using but one doesn't work yet (struggling with timing issues and tooling issues on FPGA) and the other one doesn't have Tower OS support yet.
Whilst I don't think Grant would mind, he does explicitly forbid publishing it without his permission.
Re: Julia set.
Posted: Sat Sep 01, 2018 6:16 pm
by BigEd
Ah, thanks. I'm sure Grant wouldn't mind a
link though.
Re: Julia set.
Posted: Sat Sep 01, 2018 6:18 pm
by BigEd
So... how long does it take to plot the 15000 or so pixels?
Re: Julia set.
Posted: Sat Sep 01, 2018 6:21 pm
by JenniferDigital
Depends at which clock rate I've chosen at the tine. I guess (and I've not timed it yet) probsbly around 20 minutes. Nothing like that incredible one foe the BBC.
Re: Julia set.
Posted: Sat Sep 01, 2018 6:35 pm
by BigEd
A strange attractor is a good idea: something where most of calculations result in plotting a point, rather than something where each point needs heaps of calculations.
Re: Julia set.
Posted: Sat Sep 01, 2018 6:40 pm
by JenniferDigital
I wrote a strange attractor based on some psuedocode I found in a book some time ago. Mind you, that was in FORTH on a Speccy. It'd probably only take an afternoon to get going.
There's also things like the Sierpinski Triangle that wouldn't look too bad on said low res screen.
Re: Julia set.
Posted: Sat Sep 01, 2018 7:36 pm
by JenniferDigital
@BigEd, I just added said link to the ToE wiki.
Re: Julia set.
Posted: Sat Sep 01, 2018 9:52 pm
by Chromatix
There's also the "chaotic bifurcation" formula. There's an interesting discussion of this (in a Python context) here:
https://ipython-books.github.io/121-plo ... al-system/
Re: Julia set.
Posted: Sat Sep 01, 2018 9:54 pm
by BigEd