Exercise 1.3

In order to scale to centimeters, we can use the scale command. By default, the scale is set to points, which are 1/72nds of an inch. So, we'll do a unit conversion for the x and y axis. There are 254 centimeters in 100 inches and 72 points in an inch, so we want to give the scale command that converts the desired unit into the current unit. The current unit is points, so we will find the conversion from centimeters to points. The ratio is (100 inches / 254 centimeters) times (72 points / 1 inch), which is approximately 28 points per centimeter.

write "example.ps"
28 28 scale 0 setgray newpath 2 2 moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto 0 -1 rlineto closepath fill showpage
build example.png example.ps
gs -o example.png -sDEVICE=pngalpha example.ps
picture example.png