Showing posts with label fractals. Show all posts
Showing posts with label fractals. Show all posts

Friday, 25 June 2010

A 3D Mandelbrot

Skytopia have a great set of pages on the search for a 3D version of the Mandelbrot Set. Or at least, for an interesting 3D version of the normal Mandelbrot.

It's easy enough to produce fractal solids that have a Mandelbrot on one plane, and if you plot the correct 3D shadows of the 4D Julia Set, you can find shapes that have Mandelbrots on multiple intersecting planes. But getting a Mandelbrot on two perpendicular intersecting planes, while having the transition between them being more interesting than simply spinning or rotating the thing on its axis, is more difficult.




The "normal" Mandelbrot has one "real" component and one "imaginary" component, set on the x and y axes. If you add another imaginary component on axis z, you simply get the sort of boring "spun" shape that you might produce on a lathe. If you distinguish the two "imaginary" axes by whapping a minus sign in front of one of them, you get a hybrid Mandebrot/Tricorn solid, but one of the cross-sections is then a tricorn rather than a 'brot.

From here, you can try hypercomplex numbers, number systems that support multiple distinct imaginary components and define how they should fit together. In a simple hypercomplex system, we have four components, r, i, j and k — “r” is real, i and j are identicallly-acting roots of minus one, but i-times-j gives a third creature, k, and k-squared gives plus one. So we can plot r, i, j to get a 3D Mandelbrot. Trouble is, as Skytopia point out, it's a bit boring … if we look down on the 'brot's side-bulbs, they show up as simple nubbins. There are other way to try to force Mandelbrot cross-sections, but they're a bit arbitrary, and the results tend to look like someone's cut them out of a block of wood using a Mandelbrot template.


Paul Nylander (bugman) then started looking at higher-powered counterparts of the Mandebrot, and realised that the boring hypercomplex solid for z^2 actually got pretty damned interesting when you jacked the power value up to eight (z^8). This gives a gorgeously intricate beast now referred to as a Mandelbulb, with bulbs that spawn bulbs all over the place. It also has Julia-set siblings. But it's not a standard Mandelbrot.


So what else? Well, the “standard” hypercomplex number system isn't the only option. There are alternative systems that give multiple imaginary components with slightly different interrelations. There are quaternions (tried them, didn't like them), and there are other potential configurations and a larger overarching system of eight-parameter octonions. The Mandelbrot-based solid at the top of this blog was made with one of those. The internal shape is also slightly reminiscent of a Buddhabrot.

The semitransparent voxel plot above isn't really able to show the shape properly, you can see there there's some fine floating ribs that connect some of the Mandelbrot features on the two planes that aren't being adequately captured by the plot, so I'll have to run off a larger version at some point, and perhaps experiment with some colour-coding. Some of the more exotic detail, like the floating network of ribbing, might also be an artefact of a technique I used to emphasise surface structure in the plot, so I'll need to spend some time playing with the thing and working out how much of the image is “proper” 3D Mandelbrot detail, and how much is an additional fractal contribution from the enhancement code.

But meanwhile … pretty shape!

Tuesday, 27 April 2010

'Circular' Polyhedra, and the Apollonian Net

Fractal circular tiling, giving the  Apollonian Net / Apollonian  Gasket / Liebniz packing  diagramThis is the nice design that I used on page 2 of the book.

Annoyingly, rather a lot of other people discovered it before me:
it's indexed on Wikipedia as the Apollonian Net, after Apollonius of Perga (~262 BC – ~190 BC), and it's also referred to elsewhere as the Leibniz Packing diagram, after Gottfried Leibniz (1646-1716), Newton's rival for the invention of calculus. I've even seen it credited to the design of the floor of a Greek temple. But frankly, it's such a nice shape that I'm sure that people have been discovering and rediscovering it for millennia. Draw three touching circles, fill in the inviting gap in the middle with more circles, and when you're feeling pleased with yourself and wondering what to do next, step back and look at the whole thing, draw in a bigger circle to enclose everything (facing away from you), and repeat. That's how I got there, anyway.

There's some rather interesting geometry here to do with tangents, but I got impatient trying to get a complete derivational method, and generated the figures using a vector graphics program (CorelDraw10), driven by an automating script, using a mix of partial derivations, testing, and brute force. If you're calculating a chain of circles that might be twenty or thirty stages long, successive rounding errors tend to screw up these diagrams when you calculate them "properly"(look at the overlap of the smaller circles in the Wikipedia vector graphics version), and my priority was to make sure that the circles really did fit, so I used a hybrid approach where I used trig to get each circle into the ballpark of its proper destination w.r.t. its parents, and then a successive approximation method with error correction to tweek and nudge and jiggle everything snugly into place.



The Apollonian Net makes more sense when you stretch it over the surface of a sphere, so that the four largest "primary" circles are all the same size, and are explicitly equivalent. They then form the intersection of the sphere with the four faces of a tetrahedron, giving the fractal-faceted solid that I used as a vignette on page 378.

Infinitely-truncated sphere, giving an infinite-sided polygon with circular faces, whose map corresponds to an Apollonian NetThere are two main ways to construct this solid:
1: Start with a sphere and grind four flat circular faces into it that correspond to the four faces of an intersecting tetrahedron, then keep grinding maximum-sized circular facets into the remaining curved parts, ad infinitum.

2: Start with a tetrahedron, and lop off the four points to give a shape with four regular hexagonal faces, and four new triangular faces where the tips used to be. Then continue lopping off the remaining points, ad infinitum. Each wave of cutting creates a new face at each cut, and doubles the number of sides on all the existing faces. If we cut at a depth that'll keep these polygons regular, then with an arbitrarily-high number of cuts, the faces converge toward perfect circles, and the point-mesh of the resulting peaks converges downwards to settle onto the surface of the sphere used in method 1.

Either way works.



This sort of duality is common when we construct standard polyhedra – the network of relationships in a regular polyhedron tends to be another regular polyhedron, so we can usually get to a regular shape by starting from either of its two relatives. Four of the five Platonic solids pair up nicely like this, and the last – the tetrahedron – is a special case whose "dual solid" partner is another tetrahedron. But we normally only consider these sorts of dualities when considering combinations of regular polygons with finite numbers of rectilinear sides with each other, and don't include the infinite-sided fractal shapes that show up when one of the parent solids is an infinitely-faceted sphere (which, in some ways, almost counts a a sixth Platonic solid).

We don't have to start with a tetrahedron, we can make these fractal solids from any regular polygon (cube, etc). But the tetrahedral and icosahedral versions probably look the nicest. I find the cube-based version a bit disappointing, but I grew up with rounded-cornered dice with circular faces, so perhaps I'm just a bit blasé about the solid that corresponds to the "six-circle" version of the Apollonian net.

From here, we have three immediate ways to generate new families of solids:
(1) We can choose different starting solids,
(2)
we can vary the number of cuts or cutting stages (from zero to infinity), to produce finite-sided solids that look more like cut gemstones, and
(3)
we can vary how the cutting is done. If we make our cuts too shallow, then the facets are distorted away from circularity, and the overall shape isn't a sphere, but has flat-topped bulges where the original polyhedral points used to be. If we cut too deep, we get bulges in the shape of the original solid's "dual" sibling, with each bulge tipped by an edge.



Another cool thing about these nets is their topological transformability. With the "closed" version, every circle has three parents of the same size of larger, including the four primary circles (who count as each other's parents). You can transform between the different versions of the net by warping and resizing, while still keeping everything as circles.

This lets us get to tilings that don't automatically suggest standard polyhedra, such as the "two-large-enclosed-circles" version that I used for the "fractal Yin-Yang" symbol on page 145, and the asymmetrical versions on page 224. And once I'd written the scripts and code to generate these figures, I had a few more blank bits in the book to fill, so I knocked up the "triangular boundary" version on page 370 which, actually, has some other interesting proportions. The "triangle" version includes parts that represent the limiting case of the edge of the Apollonian Gasket when we zoom in so far that the outer circle tends toward a straight line. Filling these voids then gives the special-case Ford Circles tiling.

Some serious people have worked on this subject. You can also Google Descartes' Theorem (after René Descartes (1596-1650), and Soddy Circles. Lester Ford and Frederick Soddy only produced their papers in 1936 and 1938, so the Apollonian Net involves math research that extends across more than two thousand years, and isn't finished yet.

It would have been nice to meet the person who designed that floor, though.

Monday, 21 December 2009

Fibonacci Fractals

Fibonacci FractalThis fractal's based on the Fibonacci Rose.

The original Rose has two identical interlocking spiral arms. If we delete one of them, we're left with a simple spiral chain of triangles. Each triangle has three sides – one side connects the triangle to its larger parent, one connects it to its single smaller child triangle, and the third side is unused.

Adding child triangles to two sides gives us the fractal – a characteristic cauliflower-shaped branching structure whose adjacent bunches have corners that just touch.

At larger scales, this looks just like one of the family of fractal shapes that we get by using the Golden Ratio to calculate triangle sizes, that let us zoom infinitely far in or out and always get the same shape.

Fibonacci Fractal LimitWith the "Fibonacci" versions we can zoom out infinitely far, but as we zoom in, there's a range where the proportions start to shift perceptibly away from the Golden Ratio, and then, suddenly, the branching sequence hits a dead end, and stops.

Saturday, 19 December 2009

"Snowflake" Fractal

Hexagonal 'Corner-Cluster fractal snowflake, Eric Baird 2009
If you want something that looks more like a snowflake than the previous hexagonal carpet, you could always use the "Koch Snowflake" fractal, which is gotten by repeatedly adding triangles to the sides of other triangles.
Koch Snowflake FractalBut every single general text on fractals seems to include the Koch. I mean, don't get me wrong, it's a fairly pleasant shape, but after the nth "fractals" text slavishly copying out exactly the same fractal set-pieces, you start to think ... guys, could we have a little bit of variation pleeeeaaase?

So here's a different snowflake. This one's built from hexagons. Each hexagonal corner forms a nucleation site that attracts a cluster of three smaller hexagons, and their free corners in turn attract clusters of three smaller ... you get the idea. The sample image has been drawn with about six thousand hexagons.

The resulting "snowflake" outline is really very similar to the Koch, but the internal structure's a bit more spicy. A suitable design for Christmas cards for mathematicians, perhaps.

Friday, 18 December 2009

Hex "Fractal Carpet"

Hex Fractal Carpet, Eric Baird 2009
It snowed here today! Wheee!

In honor of the White Hexagonal Fluffy Stuff, here's a nice fractal carpet made of hexagons that illustrates how an infinite number of copies of a shape can converge on a larger fixed-area version of the same shape.

This one's generated from about five and a half thousand hexagons, but obviously, you can keep going infinitely far.

The construction rule's simple. You start with one hexagon (with sides of length "one"), and then add half-size hexagons to any free corners. Then repeat, infinitely (with sides of length "one half", "one quarter", and so on).

What the process converges on is a larger completely-filled hexagon with sides of length "three", so the final area is exactly nine times the original.

Hex Fractal Carpet: Total areaIf you wanted to get even more recursive, you could try copying the entire hexagonal shape into every hexagon that you used to draw it (and then repeat that). Which would look rather cool. But take rather longer to calculate.

Friday, 3 April 2009

Trigonometric Julia Set Images

The usual Julia Set images are generated by repeatedly running the formula z→ z² + c.
But there are other things that we can do to generate variations, like trying different powers of z.
One of the cooler variations is to replace the usual Julia formula with z c× f(z), where f(z) is a trig function. This was the method I used to create the (TAN-based) cellular and (SIN-based) circley fractals in the 1st March and 9th February blog posts.

Thanks to Pythagoras' Theorem, trig functions include terms, so there's a certain amount of crossover between the "conventional" and "sine" Julia sets.

Web-wise, priority seems to go to Paul Bourke and Tim Meehan for putting up a webpage on "Julia set of sin(z)" nearly ten years ago.

For those who want to see more, there are some more "sine Julia" and other "trig Julia" images on the relativitybook.com website on three new pages, here, here and here. The third page shows how more complex and more strongly repeating versions of the more familiar Julia Set images (example above) appear within the "sine Julia" parameter set.

Some of the pictures are cool.

Saturday, 21 March 2009

'Hyperbolic Planar Tesselations', by Don Hatch

John Baez's "This week's finds in Mathematical Physics" page often has links to math goodies. I haven't visited it for a while (where "a while" is probably measured in years), but I had a peek today, and it had a link to a site containing a whole collection of these beasties:

thumbnailof images from 'Hyperbolic Planar Tesselations' at http://www.plunk.org, by Don HatchIt's a page by Don Hatch called Hyperbolic Planar Tesselations, and it's full of links to larger versions of the pretty pictures. The image selected on the Baez page is especially nice, because it shows the tiling that you can achieve in negatively-curved space by replacing the usual flat-spacetime hexagonal tiling with heptagons. These regular tilings don't work in a flat plane. If we extrude a flat plane in one direction, then the amount of space per unit area, as judged within the plane, is less than we'd expect. If we extrude in two opposing directions (to produce a "saddle" or "pringle" shape), then as we draw larger shapes on the surface, they include progressively more area that we'd normally expect, thanks to all the folds and crinkles, and the resulting hyperbolic plane allows things like regular heptagonal tiling.

Okay, so I'm probably a sucker for tables of blue, black, and white geometrical figures, but even so, the "Don Hatch" page is really very nice. Some of the figures are reminiscent of Apollonian Net diagrams, which I'm quite fond of as fractal tiling systems, and which also in turn tend to correspond to maps of fractal-faceted solids with an infinite number of circular faces that you can achieve by continually grinding maximally-sized flat circular facets into the remaining curved surface of a truncated sphere:
Infinitely-truncated sphere, giving an infinite-sided polygon with circular faces, whose map corresponds to an Appollonian gasket
I put a quick illustrative connection map of heptagonal space on p.27 of the book ("3: Curved Space and Time"), but it was really just a crude sketch. So while my first reaction to the Hatch page was "Wow! Cool!", my second was, "Damn, I wish I'd done that".

Sunday, 1 March 2009

Cell Fractal

Here's a nice example of a "cell" fractal that I've been staring at, off and on, for the last week or so:


I probably didn't have to zoom in quite so far to demonstrate the thing, but I thought, what the hell, let's just leave the Eee Box running until the zoom calculations hit the 32-bit floating-point limit.

The zoom doubles in size every second, and does that for about 47 seconds.

At some point there'll be a web page to go with this, but it's not quite finished yet.

Saturday, 21 February 2009

My Favourite 3D Fractal

It's this one:


3D fractal solid, z^2, rear view3D fractal solid, z^2
3D fractal solid, z^2

It reduces to the Mandelbrot Set on one plane, and to the "Tricorn" or "Mandelbar" fractal on another. And there's a stream of self-similar solids emanating from the main pointy bit.

I don't only like this fractal because I don't know of anyone else having found it before me ... okay, perhaps that is a contributing factor ("It's MY fractal, Miiiiiine!"), but there are other fractal solids in the same series and I don't like those nearly so much. And according to my YouTube stats, neither do other people.


Now, if only I had access to a high-resolution 3D printer ...

Friday, 20 February 2009

Edible 3D Fractals

If you're into fractals, you've probably already heard of the Romanescu.

It's a relative of the cauliflower, and it produces a spiralling cone made up of smaller spiralling cones, which in turn are made of of smaller ... well, you get the idea. Imagine a pinecone, where each segment is a protruding mini-pinecone, composed of segments that are also mini-mini-pinecones, and you have some idea of what a romanscu looks like, up-close.
Oh, and they're a livid shade of green.

romanescu
romanescuromanescuromanescu

If M.C. Escher had designed a vegetable, this would be it.

You might now be tempted to track down lots of awfully pretty artsy photos of romanescu on the net. I'd advise you not to bother. Instead take a trip to your local chi-chi supermarket and buy some, for real.
I got a pair for about one pound fifty, at the local Waitrose. They're awfully cute, they're much more fun to stare at in real life than someone else's photo, and when you eventually get bored with them, you can eat them!

Steam them, or wet them, cover them and shove them in the microwave for a couple of minutes.
They taste a little like cauliflower. Cheese sauce is optional.

Monday, 9 February 2009

Cool Circley Fractal!

While playing about with some Mandelbrottish code, I've managed to find a fractal that looks like it's entirely made out of circles:

'Sun-Disc' fractal
Instead of having Mandelbrots that spawn "mini-Mandelbrots", it's got circles spawning "mini-circles".

Yaaay Me!

I may have to adopt a version of this as my new logo ...