PICTURE Circle (SINGLE Center_X, Center_Y, Radius) !+ ! This picture will draw a circle, with its center at the ! point specified by (Center_x, Center_y), and the radius as ! specified in Y world coordinates of the current transformation. !- OPTION TYPE = EXPLICIT EXTERNAL SUB ASK_REALIZED_DEVICE_VIEWPORT (LONG, SINGLE, , ,) DECLARE LONG trans_num DECLARE SINGLE x, increment, initial_x, aspect_ratio, & dc_min_x, dc_max_x, dc_min_y, dc_max_y, & wc_min_x, wc_max_x, wc_min_y, wc_max_y, & vp_min_x, vp_max_x, vp_min_y, vp_max_y, & dw_min_x, dw_max_x, dw_min_y, dw_max_y ASK TRANSFORMATION trans_num ! ASK DEVICE VIEWPORT dc_min_x, dc_max_x, dc_min_y, dc_max_y CALL ASK_REALIZED_DEVICE_VIEWPORT (0%, dc_min_x, dc_max_x, & dc_min_y, dc_max_y) ASK DEVICE WINDOW dw_min_x, dw_max_x, dw_min_y, dw_max_y ASK WINDOW , TRAN trans_num: wc_min_x, wc_max_x, wc_min_y, wc_max_y ASK VIEWPORT , TRAN trans_num: vp_min_x, vp_max_x, vp_min_y, vp_max_y aspect_ratio = dc_max_y / dc_max_x * & ( (wc_max_x - wc_min_x) / (wc_max_y-wc_min_y) ) * & ( (vp_max_y-vp_min_y) ) / (vp_max_x - vp_min_x) * & ( (dw_max_x - dw_min_x) / (dw_max_y-dw_min_y) ) Increment = .0125 ! Increment between points on the circle Initial_X = Center_X / Aspect_ratio ! First X adjusted by aspect ratio FOR X = 0 TO 2 * PI STEP Increment PLOT LINES: & (Radius * SIN (X) + Initial_X) * Aspect_Ratio, & Radius * COS (X) + Center_Y; NEXT X !+ ! Close the circle and turn off the beam !- PLOT LINES Initial_X * Aspect_ratio, Radius + Center_Y END PICTURE