space and games

October 24, 2006

Zermelo

Filed under: General — Peter de Blanc @ 11:22 am

My gridfont, named after this guy.

Zermelo

I didn’t use the whole grid; I wanted to keep all of the letters small. I also avoided using diagonals where possible. I used four diagonals for the “x.” Later I realized that the “x” could be a swastika, and then it wouldn’t need any diagonals, but for obvious reasons I left it as is.

October 19, 2006

Candy

Filed under: General — Peter de Blanc @ 11:05 pm

I made a little Python script for plotting curves. It’s called Candy. You need the Python Image Library to run it. Candy is pretty slow; sorry.

plot() takes a function on two arguments, and plots the zeroes of the function by tracing the edge between positive and negative values. So if you wanted to plot, for example, the parabola y=x2, you would send it the function f(x, y) = x2y, just like this:

plot(lambda x,y: x*x-y)

Parabola

You can also plot inequalities, but it works opposite to how you would expect, because Candy plots the zeroes of your function, and False (not True) is zero in Python.

plot(lambda x,y:x*x+y*y>1)

Unit Ball

If you send plot() a list of functions, it will plot all of them. You can also use different colors for each. Here I’m plotting a Folium function over a grid function.

plot([grid(), lambda x,y:x**3+y**3-3*x*y], colors=[0x303030, 0xa0a0a0])

Folium of Descartes

You can also plot multiple functions by multiplying them, but then you would not be able to use different colors for each.

Powered by WordPress