'=========================================================================== ' Subject: SIMPLE HARMONIC MOTION Date: 04-18-99 (21:56) ' Author: Ross Harper Code: QB, QBasic, PDS ' Origin: t.r.harper@btinternet.com Packet: GRAPHICS.ABC '=========================================================================== '' Howdy! '' Just a little program that I threw together one Sunday, in the hope of '' illustrating Simple Harmonic Motion for my A-Level Physics. '' '' As you can probably guess, I need more revision... '' '' Not much of a program mind you, but let me know what you think. '' '' Ross '' Peachy512@yahoo.com '' ICQ: 15844814 '' The Zax Bypass: http://members.xoom.com/Peachy512/Asylum/home.htm DECLARE SUB pause (s!) SCREEN 9 ''INPUT "Amplitude.."; A ''INPUT "Pulsitance.."; w pi = 3.141592654# a = 50 f = 10 w = 2 * pi * f ''draw grid! LINE (0, 200 - a)-(0, 200 + a), 14 LINE (0, 200)-(640, 200), 14 x1 = 0: y1 = 200 FOR t = 5 TO 640 STEP 1 w = INT(2 * pi * f) y = 200 + (a * SIN(w * t)) LINE (x1, y1)-(t, y) y1 = y: x1 = t pause (1) a$ = LCASE$(INKEY$) IF a$ = "q" THEN w = w + 5 IF a$ = "a" THEN w = w - 5 IF a$ = "e" THEN f = f + 5 IF a$ = "d" THEN f = f - 5 IF a$ = "w" THEN a = a + 5 IF a$ = "s" THEN a = a - 5 LOCATE 1, 1: PRINT "A="; a LOCATE 2, 1: PRINT "w="; w LOCATE 3, 1: PRINT "f="; f NEXT t SUB pause (s) FOR zog = 1 TO s starttime = TIMER DO LOOP UNTIL TIMER <> starttime NEXT zog END SUB