'=========================================================================== ' Subject: GEOMETRY OF A CIRCLE Date: 11-05-96 ' Author: Steven A. Morisi Code: QB, QBasic, PDS ' Origin: steve179@ix.netcom.com Packet: GRAPHICS.ABC '=========================================================================== DECLARE SUB define5 () DECLARE SUB define3 () DECLARE SUB define4 () DECLARE SUB define1 () DECLARE SUB define2 () DECLARE SUB circinit () DECLARE SUB header1 () DECLARE SUB choices () ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Geometry Definitions for Circles ' Author : Steven A, Morisi ' Date : 10/96 ' Notes : E-Mail with comments to steve179@netcom.com ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' CLS SCREEN 9 COLOR 7, 1 WIDTH 80, 43 'give myself more room header1 'print header circinit 'print initial circle choices 'Display choices DO DO key.press$ = INKEY$ LOOP WHILE key.press$ = "" ' PRINT key.press$ SELECT CASE UCASE$(key.press$) CASE IS = "D" CLS choices header1 circinit LINE (308, 165)-(548, 165), 9 define1 CASE IS = "R" CLS choices header1 circinit LINE (308, 165)-(428, 165), 9 define2 CASE IS = "C" CLS choices header1 circinit CIRCLE (428, 165), 120, 9 define3 CASE IS = "H" CLS choices header1 circinit LINE (309, 170)-(505, 100), 9 define4 CASE IS = "T" CLS choices header1 circinit LINE (300, 102)-(480, 60), 9 define5 CASE IS = CHR$(27) EXIT DO END SELECT LOOP SYSTEM SUB choices FOR i% = 0 TO 3 STEP 3 LINE (50 - i%, 55 - i%)-(205 + i%, 200 + i%), 5, B NEXT i% LOCATE 9, 8: PRINT " Press a letter " LOCATE 11, 8: PRINT " (D)iameter " LOCATE 13, 8: PRINT " (R)adius " LOCATE 15, 8: PRINT " (C)ircumference " LOCATE 17, 8: PRINT " c(H)ord " LOCATE 19, 8: PRINT " (T)angent " LOCATE 23, 8: PRINT " Escape : Quit " END SUB SUB circinit CIRCLE (428, 165), 120, 2 PSET (428, 165), 4 END SUB SUB define1 'Diameter definition 'SOUND 600, 4 LINE (50, 285)-(590, 305), 3, BF LOCATE 37, 8 PRINT " The diameter is any line that starts somewhere on the circle, " LOCATE 38, 8 PRINT " goes through the center and touches the circle on the other side." END SUB SUB define2 'Radius definition 'SOUND 700, 4 LINE (50, 285)-(590, 305), 3, BF LOCATE 37, 8 PRINT " The Radius is any line that starts at the center and goes to the " LOCATE 38, 8 PRINT " edge of the circle. It is 1/2 the diameter. " END SUB SUB define3 'Circumference definition 'SOUND 600, 4 LINE (50, 285)-(590, 305), 3, BF LOCATE 37, 8 PRINT " The Circumference is the distance around the circle. You can " LOCATE 38, 8 PRINT " calculate the circumference by multiplying the diameter x pi. " END SUB SUB define4 'chord definition 'SOUND 600, 4 LINE (50, 285)-(590, 305), 3, BF LOCATE 37, 8 PRINT " A chord is a line that touches a circle in 2 places. The diameter" LOCATE 38, 8 PRINT " is the largest chord of a circle. " END SUB SUB define5 'tangent definition 'SOUND 600, 4 LINE (50, 285)-(590, 305), 3, BF LOCATE 37, 8 PRINT " A TANGENT is a line that touches a circle in ONLY 1 place. " LOCATE 38, 8 PRINT " " END SUB SUB header1 ' Draw box in which to display circle LINE (275, 50)-(590, 275), 15, BF ' Title on Box LOCATE 5, 47: PRINT " CIRCLE FACTS " END SUB