Eric Weeks
- personal pages -
computer-generated picturesSpot of spots |
weeks/physics.emory.edu |
I got this idea from some paintings I saw in the San Francisco Museum of Modern Art. I basically created a 3D surface z(x,y) and drew a circle of size proportional to z. The picture was made using postscript and converted to GIF.
Here is the complete gawk script I used to create the picture:
#! /bin/sh
gawk '
BEGIN {
pi=3.14159265
deg=pi/180
scale=0.8
windowx=18/scale
windowy=22/scale
print "%!PS-Adobe-1.0"
print "gsave"
print "matrix currentmatrix /originmat exch def "
print "/umatrix {originmat matrix concatmatrix setmatrix} def "
print "[28.3465 0 0 28.3465 10.5 100.0] umatrix"
print "0 0 0 setgray"
for (n=-5;n<40;n++) {
for (m=-40;m<40;m++) {
x = m+cos(60*deg)*n
y = sin(60*deg)*n
if ((x > 0)&&(y > 0)&&(x < windowx)&&(y < windowy)) {
z = (x-4)*(x-10)+(y-10)*(y-10);
z = (sin(z/30)+2)/3
print x*scale+2,y*scale
print z/2.8,0,360
print "arc closepath fill"
}
}
}
print "showpage grestore"
}'