/* Program: circles.c Try out the graphics library. Draw lots of circles. */ #include #include "genlib.h" #include "simpio.h" #define CIRCLES 13 /* include the Graphics Package */ #include "graphics.h" main() { double x, y, max_x, max_y ; double mid_x, mid_y ; double radius, increment ; int i ; /* Initialize graphics routines */ InitGraphics() ; /* Find out window sizes */ max_x = GetWindowWidth() ; max_y = GetWindowHeight() ; mid_x = max_x / 2.0 ; mid_y = max_y / 2.0 ; increment = mid_y/(CIRCLES + 1) ; radius = increment ; for ( i = 1 ; i <= CIRCLES ; i++ ) { MovePen(mid_x + radius, mid_y) ; DrawArc(radius, 0.0, 360.0) ; radius = radius + increment ; } }