6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 12:47 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Julia set.
PostPosted: Sat Sep 01, 2018 5:14 pm 
Offline

Joined: Mon May 25, 2015 1:12 pm
Posts: 92
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:
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?


Attachments:
ToE-Julia.jpg
ToE-Julia.jpg [ 229.7 KiB | Viewed 12553 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Julia set.
PostPosted: Sat Sep 01, 2018 5:38 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
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.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Julia set.
PostPosted: Sat Sep 01, 2018 5:47 pm 
Offline

Joined: Mon May 25, 2015 1:12 pm
Posts: 92
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Julia set.
PostPosted: Sat Sep 01, 2018 6:16 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Ah, thanks. I'm sure Grant wouldn't mind a link though.


Top
 Profile  
Reply with quote  
 Post subject: Re: Julia set.
PostPosted: Sat Sep 01, 2018 6:18 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
So... how long does it take to plot the 15000 or so pixels?


Top
 Profile  
Reply with quote  
 Post subject: Re: Julia set.
PostPosted: Sat Sep 01, 2018 6:21 pm 
Offline

Joined: Mon May 25, 2015 1:12 pm
Posts: 92
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Julia set.
PostPosted: Sat Sep 01, 2018 6:35 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Julia set.
PostPosted: Sat Sep 01, 2018 6:40 pm 
Offline

Joined: Mon May 25, 2015 1:12 pm
Posts: 92
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Julia set.
PostPosted: Sat Sep 01, 2018 7:36 pm 
Offline

Joined: Mon May 25, 2015 1:12 pm
Posts: 92
@BigEd, I just added said link to the ToE wiki.


Top
 Profile  
Reply with quote  
 Post subject: Re: Julia set.
PostPosted: Sat Sep 01, 2018 9:52 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
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-plotting-the-bifurcation-diagram-of-a-chaotic-dynamical-system/


Top
 Profile  
Reply with quote  
 Post subject: Re: Julia set.
PostPosted: Sat Sep 01, 2018 9:54 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
We had one of those in BBC Basic over on stardot:
https://stardot.org.uk/forums/viewtopic ... 00#p200300


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: