Monthly Archives: June 2007

Cool Feature on NY Times Website

I was just reading an article on the New York Times entitled “Science of the Soul? ‘I Think, Therefore I Am’ Is Losing Force” and while reading I came across the word “palaver” in the text. Not knowing its meaning I double clicked on it to highlight it so I could easily paste it into Ubuntu’s dictionary, but there was no need. The website popped open a window with the definition for me. Pretty cool! I wonder how long this has been working?

Sierpinski Tetrahedron (Tetrix) C++ Code

I modified my Sierpinski triangle code from a previous posting to work in three dimensions instead of two. The result is a short C++ program which will generate all the points of the Sierpinski tetrahedron and write them to stdout (you can redirect to a file).

Below is the obligatory image. This doesn’t look great but if you plot it yourself in gnuplot or some other package, you can probably get a prettier looking picture.

Sierpinski Tetrahedron

Cool Ubuntu Desktop Trick

I just discovered that you can switch among open applications by positioning your mouse cursor over any app icon in the bottom toolbar and then scrolling your mouse wheel. Before I would always use Alt-Tab from the keyboard. Now I can use the mouse method when my hands are not on the keyboard.

Sierpinski Triangle C++ Code

If you like pretty pictures, and I know you do, below is a plot of Sierpinski’s Triangle which you can generate with the short C++ program I wrote. This is an example of a fractal–an object that is self similar at all levels of magnification.

Sierpinski Triangle

On a Linux/UNIX system, to compile and run the code type:

$ g++ -o sierpinski
$ ./sierpinski >out
Enter depth (integer > 0, usually 10 is good): 10
Enter contraction mapping constant (for example 0.5):  0.5

Now the points are stored in a file called ‘out’. To plot them you can use gnuplot like so:

$ gnuplot
gnuplot> plot 'out' with points pointtype 0

Kaliope Now Includes Gravitational Potentials

I’ve added a C++ class that handles gravitational potentials to my Kaliope project. Below is a picture of a binary cluster orbiting around a logarithmic potential well. A logarithmic potential is the simplest kind of potential well. It corresponds to an inverse distance radial force field.


Here is a slightly different simulation, with each body given its own color, so it is easier to see individual paths: