#include #include /* C-Program that creates a piece of graph paper. Nothing fancy, but it works. The main thing to change would be GRID. */ #define LEFT -1.20 /* value of x at left of window */ #define RIGHT 1.20 #define BOTTOM -1.20 /* value of y at bottom of window */ #define TOP 1.20 #define FRAME_WIDTH 8 #define FIFTH_WIDTH 12 #define GRID 40 main() { int i,j,k; printf("w %2.3f %2.3f %2.3f %2.3f\n",LEFT,BOTTOM,RIGHT,TOP); for(i=0;i<=GRID;i++) { printf("m -1.0 %2.3f \n", (-1.0 + 2.0*i/GRID)); printf("l 1.0 %2.3f \n", (-1.0 + 2.0*i/GRID)); } for(i=0;i<=GRID;i++) { printf("m %2.3f -1.0 \n", (-1.0 + 2.0*i/GRID)); printf("l %2.3f 1.0 \n", (-1.0 + 2.0*i/GRID)); } printf("W %d\n", FRAME_WIDTH); for(i=0;i<=GRID;i=i+5) { printf("m -1.0 %2.3f \n", (-1.0 + 2.0*i/GRID)); printf("l 1.0 %2.3f \n", (-1.0 + 2.0*i/GRID)); } for(i=0;i<=GRID;i=i+5) { printf("m %2.3f -1.0 \n", (-1.0 + 2.0*i/GRID)); printf("l %2.3f 1.0 \n", (-1.0 + 2.0*i/GRID)); } for(i=0;i<=GRID;i=i+5) { printf("m -1.13 %2.3f \n", (-1.01 + 2.0*i/GRID)); printf("T %2.1f\n",(double)i); } for(i=0;i<=GRID;i=i+5) { printf("m %2.3f -1.07 \n", (-1.04 + 2.0*i/GRID)); printf("T %2.1f\n",(double)i); } }