/* spring.c spring and mass */ #include #include #include #include static Display *dpy; static Window window1; static GC gc_rubber; static Screen *screen; static int winWidth = 600; static int winHeight = 400; static int tracking = 0; /* left button down, sense motion */ static int startX = 0; static int startY = 0; static int currentX = 0; static int currentY = 0; void display(void); void rubberRect(int x0, int y0, int x1 , int y1) { /* can apply to all figures */ /* draw a rubber rectangle, mouse down, tracks mouse */ int x, y; x=x0; if(x1