fb:porticula NoPaste
Sinus-/Cosinus-Animation
Uploader: | Sebastian |
Datum/Zeit: | 01.06.2008 16:28:48 |
'Sin-/Cos-Animation
'Relativ sinnlos, aber ganz nett anzuschauen ;-)
'Sebastian Steiner, 01.06.2008
'Getestet mit FreeBASIC 0.20.0 SVN
CONST Pi = 3.14159
CONST Grad = Pi/180
DIM AS DOUBLE Start=0, Winkel, y, lysin=0, lycos=0
DIM AS INTEGER i
SCREEN 12
DO
SCREENLOCK
CLS
'LINE (0,240)-(639,240),7 '<= x-Achse anzeigen?
Winkel = Start
FOR i = 0 TO 639
y = 240-SIN(Winkel)*240
IF i = 0 THEN
PSET (0,y),12
ELSE
LINE (i-1,lysin)-(i,y),12
END IF
lysin = y
y = 240-COS(Winkel)*240
IF i = 0 THEN
PSET (0,y),14
ELSE
LINE (i-1,lycos)-(i,y),14
END IF
lycos = y
Winkel += Grad
NEXT i
SCREENUNLOCK
Start += Grad
If Start > (2*Pi) Then Start = 0
SLEEP 1
LOOP UNTIL INKEY <> ""
END