'=========================================================================== ' Subject: ROTATING HORIZONTAL LINE Date: 01-04-99 (23:33) ' Author: Roger Hermans Code: QB, QBasic, PDS, PB ' Origin: r.hermans@planetinternet.be Packet: GRAPHICS.ABC '=========================================================================== DECLARE SUB s.Wait (A$) 'For PowerBasic and QBasic. 'Driedim1.bas 1/4/1999. 'the first example = Geo1.bas. (example for the basic of triangles). 'r.hermans@planetinternet.be 'this is a simplefied example to rotate on the screen. '--------------------------------------------------------------------------- SCREEN 12 PI# = 4 * ATN(1) px = 320: py = 240: Straal = 319: Angle = 1 DO '-------------------------------------------------------------------------- 'p2x = the X. 'p2y = the Y, and you can move it higher or lower. 'if you not hold p2y on a fixed hight, then it go twodimensional. 'so see the example for twodimensional. 'and see the example for two lines (L + R). '-------------------------------------------------------------------------- p2x = px + Straal * COS(PI# / 180 * Angle) 'p2y = py + Straal * SIN(PI# / 180 * Angle) 'example for twodimensional. p2y = py - 6 '----------------- 'twolines example. 'p3x = px + -Straal * COS(PI# / 180 * Angle) ''p3y = py + - Straal * SIN(PI# / 180 * Angle) 'example for twodimensional. 'p3y = py + 6 'LINE (px, py)-(p3x, p3y), 10 '----------------------------- LINE (px, py)-(p2x, p2y), 10 LOCATE 1, 1: PRINT "Esc = exit" s.Wait A$ CLS Angle = Angle + 2 IF A$ = CHR$(27) THEN LOCATE 8, 12: PRINT "Roger Hermans * * * * * * Driedim1.bas * " LOCATE 10, 12: PRINT "See You on the Internet r.hermans@planetinternet.be" END END IF LOOP '************************************************************************** SUB s.Wait (A$) DO LOCATE 1, 60: PRINT TIME$ LOCATE 28, 1: PRINT "Push button" A$ = INKEY$ IF A$ <> "" THEN EXIT DO LOOP END SUB