## Archive for the ‘**math**’ Category

## T-Square Fractal Cubes

If you don’t already know, I like fractals a lot.

A few months ago I was playing around with the T-Square fractal. Recently I decided to revisit this fractal and try to add another dimension. So instead of using squares, I decided that I’d use cubes and make the rules the same. For each free corner on a cube, create another cube and repeat.

So I wrote a small program in Python that creates a scene for Povray (speaking of which, I wasn’t able to find any good libraries for talking to Povray in Python! If anyone knows of such a library, I’d love to know.)

Anyway, here are the results:

I’d love to make a video out of this but I don’t think my budget can afford it right now. The frame you see above you took about an hour or so to render on my laptop. Unless anyone has a cluster they’re willing to lend me, I’ll have to stick to stills for now.

**Update 3/26/12:**

I decided to 3d print it. Printed on a 3d powder printer at Makers Factory in Santa Cruz.

In order to get it made into a proper 3d file, I actually ended up writing a Python script for Blender, you can find that here. Turns out that scripting Blender is way easier than writing .STL files — just to write a cube you need to define a bunch of vertices’s and get them all in the right order or the normals are screwed up.

**Update (again) 4/16/12:**

I sent away to Shapeways to get it printed in black plastic.

## Lasers, Smoke, and Ice

Smoke is really interesting. It’s a gas, so it ends up being very chaotic, especially when turbulent.

I was playing with lasers the other day and had the idea to make two-dimensional a plane of laser light and project it through smoke, effectively visually ‘cutting’ the laser smoke into a slice that I could see. So I attached a mirror with a 45 degree tilt to a computer fan, pointed a 5mW green laser at it, and spun it up.

After searching for the appropriate medium to create smoke (incense didn’t make enough to be very visual), my friends and I settled on using dry ice.

Here’s a picture with the lights on.

And another with the lights out, this time of just a cube of dry ice held above the laser:

The whole device was really easy to build (most computer case fans take 12 volts DC and you can get small mirrors at art supply stores). If you do end up making one of these devices, just please remember to be safe around lasers and dry ice. Never look a laser in the eye and never keep dry ice in an airtight container (it will explode).

And I’ll leave you with a video:

Oh, and thanks to Julia for helping and Jon for the photography.

## Fun with an HP 7475 Plotter

So I got an HP 7475 Plotter used. I’ve been playing with it using a Python library called Chiplotle.

Recently I’ve been making fractals on it. Here’s a Hilbert curve I made:

Hilbert curves are space filling fractal curves. This means that when iterated to infinity, at no point is there a straight line; thus it is a curve. Very neat!

In order to get this to work, I wrote a turtle graphics class for the Chiplotle library. If anyone finds this useful, you can grab the code here.

Oh, and here’s a Sierpinski triangle:

## LEDs on a String

Okay, so a friend and I got bored and decided to play with this idea. We attached a few leds to some thin string (we used dental floss), creating a pendulum. Then we turned off the lights, pointed a camera up, opened the shutter for about 25 seconds and released the led:

And then we tried making a double pendulum by adding a second, green, led.

Double pendulums are neat! They’re incredibly complex despite their simple construction, but can be correctly modelled with math.

Here’s our setup for the double pendulum. And remember, if you decide to try this, use a resistor in series with each led.

## Buddhabrot 4-Dimensional Rotation

I’ve been playing with fractals recently. More specifically, the Buddhabrot fractal.

The Buddhabrot set is closely related to the Mandelbrot set:

The mandelbrot set is displayed on the complex plane, where one axis is the real component of (we’ll call it ) and the other is the imaginary component of (a.k.a ).

With the Buddhabrot set, we can add a few more axes. Instead of just using and , we also use the real and imaginary components of as axes. Whereas in the Mandelbrot set, is assumed to be , in our 4D Buddhabrot set, we make these values variable as well.

So instead of the two dimensional image you’re used to seeing of the Mandelbrot set, we’ve instead got 4 axes: and .

Which leads us to our next problem — how do you visualise a 4 dimensional object on a computer? Well, it’s difficult. You obviously can’t just draw an image of it, or even just show a 3 dimensional picture of it. Instead, we show it rotation in 4 dimensional space.

So, here’s the result:

I’ve made all of this code open source — here’s the project page.