图形渐变程序
' This Program is Runing in Turbo Basic
SCREEN 12 : CLS
DIM Static X1(360),X2(360),Y1(360),Y2(360)
CALL init(X1(), X2(), Y1(), Y2())
FOR i = 0 TO 40
FOR j = 1 TO 360
x = (X2(j) - X1(j)) / 40 * i + X1(j)
Y = (Y2(j) - Y1(j)) / 40 * i + Y1(j)
x = x + 320: Y = Y + 240
IF i = 1 THEN PSET (x, Y): bx = x: by = Y
LINE -(x, Y)
NEXT j
LINE -(bx, by): delay 1: CLS
NEXT i
SUB init (X1(1), X2(1), Y1(1), Y2(1))
FOR angle = 1 TO 360
X1(angle) = 200 * COS(3.14159 * angle / 180)
Y1(angle) = 100 * COS(3.14159 * angle / 90)
X2(angle) = X1(angle)
Y2(angle) = 100 * SIN(3.14159 * angle / 180)
NEXT angle
END SUB
运行上述程序后,你就会看到由抛物线逐渐变化到圆的奇妙过程了。