Jump to content

I did the Brot


Recommended Posts

I was toying with the HTML <canvas> element and finally got round to drawing a Mandlebrot set. I wanted to make it infinitely zoomable, but I discovered after zooming a million times or so, Javascript runs out of precision. I need a bigger number!

image.png.e1be1bb4f59e2e2157ae0fc6f2927cf9.png

  • Like 12
Link to comment
Share on other sites

Very neat.

As you may know, the Mandelbrot set is the map of all connected Julia Sets.

Back when I started BASIC programming, I developed a MB generator, and then developed a secondary function to plot the Julia Set that corresponded to any particular point on the MB set.

It was interesting to see how the overall shape of the JS depended on where the starting point was on the MB set. After a while you could tell where to start if you wanted JSs that had 2 main branches, or 3 branches, or 4 or more.

Some interesting findings.

If I was a born mathematician I'd probably have been able to make something of it - though more likely, I'd have found it was a well known thing in the field.

Now I'm retired I must try to recreate the programme. 

Edited by Gfamily
  • Like 2
Link to comment
Share on other sites

9 minutes ago, Gfamily said:

As you may know, the Mandelbrot set is the map of all connected Julia Sets.

All I know is its maths, its infinitely complex, and it's on my screen 🫠

This is actually stage zero of a web based image processing idea I have. Now that I can draw Mandelbrot, I can draw the contents of a FITS file...

 

Link to comment
Share on other sites

15 minutes ago, Gfamily said:

As you may know, the Mandelbrot set is the map of all connected Julia Sets.

Thinking about it, how can sets be "connected"? If two sets are connected aren't they just one set?

Link to comment
Share on other sites

2 minutes ago, Ags said:

Thinking about it, how can sets be "connected"? If two sets are connected aren't they just one set?

A Julia Set is a set of points on a plane surface. If every point in the set  is adjacent to another point in the set, so they form a single area on the surface, rather than having separate islands, it's said to be connected.

  • Thanks 1
Link to comment
Share on other sites

Mandelbrot set is best understood as:

Set of all points c in complex plane that have following property:

Let z_sub_n = z_sub_n-1^2 + c

which is iterative formula. If we start with z_0 = 0 - we never leave unit circle - or module of any such iteration stays below 1 (up to infinity).

In Mandelbrot set - c has coordinates of point we want to examine - if it belongs to set or not.

Julia set on the other hand has the same exact iterative formula

z_sub_n = z_sub_n-1^2 + c

and it is used to define a set of points on complex plane by the same criteria - except, here c is constant so we can have say Julia set for c=0.2 or c=0.5-0.3i (any complex number), but starting z or z_0 is coordinate of point we examine.

These sets are related and have similar fractal properties - but different thing is used to determine if point belongs to set or not. There is single Mandelbrot set, but there are infinitely many Julia sets - one for each constant c.

  • Like 3
  • Confused 1
Link to comment
Share on other sites

  • 3 weeks later...

Back in the 90's I read a book "Chaos" by James Gleik, It was eye opener to me and included Mandelbrot's original algorithm. I wrote a program in BASIC on my  BBC micro model B. It took days to run a deep ( highly "magnified") iteration. Just a few line of code opened a whole universe to me.

What' not to like about the Beetle? 

  • Like 3
Link to comment
Share on other sites

13 minutes ago, saac said:

Those images are trippy :)

Jim 

Who needs narcotics when you can just do maths?

  • Like 1
  • Haha 1
Link to comment
Share on other sites

I am staying up watching current events, and trying to add a user interface to this, so people can play with it, setting colors, animations and zoom levels. I want it infinitely zoomable but it hits the limits of javascript maths. I'll try use a BigDecimal library to see if I can got to higher zoom levels, to better create the illusion of infinity. But it's getting a bit late and my head is getting foggy :D  

Link to comment
Share on other sites

I have been thinking why it looks so organic. Perhaps I have it the wrong way round. The question is not "why does this fractal looks organic?", rather it is "are there any fractals that don't look organic to humans?"

Link to comment
Share on other sites

On 18/06/2024 at 22:35, Ags said:

How can this be mathematics? It seems organic.

image.png.23bbc4155ab2f22af43c16f43e91b82d.png

Mathematics describes nature. Could a Mandlebrot set not look organic?

Olly

Link to comment
Share on other sites

I discovered FRACTINT back in the days when my computer ran MS-DOG as its only operating system. I'm pleased to find that it still exists and has been ported to Linux.

  • Like 1
Link to comment
Share on other sites

Posted (edited)

Xaos is very nice, I think they are using upsampling and GPU acceleration. I added multithreading to my script today but it is still a slideshow. Xaos gave me an idea for pseudorandomised colors, which I have now implemented. 

image.png.075efb91afc4ef70f95968aaa5f76a8c.png

It looks like I can zoom in about 50 times, with each zoom doubling the magnification. That's a million billion zoom!  (Unless I've got my zoom ratio wrong...)

Edited by Ags
  • Like 2
Link to comment
Share on other sites

On 06/07/2024 at 16:58, Xilman said:

I discovered FRACTINT back in the days when my computer ran MS-DOG as its only operating system. I'm pleased to find that it still exists and has been ported to Linux.

Ah FRACTINT (all caps.) that takes me back a few years :) It was quite a while before it (and I ) caught up with windoze let alone Linux ! 

50 minutes ago, Ags said:

pseudorandomised colors,

I love finding miniBrots :) and how their symmetry falls lopsided depending !


On your hint of html<canvas> I have been googling a few versions and they are quite interesting (and surprisingly nippy for in-browser use) but all disappointingly pale at deep zooms.. Hope your new randomized colours works out good.
 

Link to comment
Share on other sites

Posted (edited)
15 hours ago, MalcolmP said:

On your hint of html<canvas> I have been googling a few versions and they are quite interesting (and surprisingly nippy for in-browser use) but all disappointingly pale at deep zooms.. Hope your new randomized colours works out good.

bright enough for you?

image.png.bada77939f54a5cc01577390c4f9147b.png

I am trying to upload the beta version to my website at https://discovering-astronomy.eu but having issues with Google Cloud saying no. 

Edited by Ags
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.