10 ! This program draws a damped sine wave, like in the previous example 20 ! except that the axis labels are not integers. The actual labeling is 30 ! done with two program loops. Note that the loop that labels the "Y" 40 ! axis has some special provisions for labeling the "0.0" value; this is 50 ! necessary because Tech BASIC uses binary (not BCD!) numbers and the 60 ! computation that was providing the "Y" axis values was providing a value 70 ! for "0.0" that was slightly less than zero. 80 ! 90 INTEGER NUMBER_OF_SAMPLES,NUMBER_OF_TICKS,sample 100 REAL LENGTH_OF_SCAN,SAMPLE_SIZE,AMP,TC,FREQ,X_TICK,Y_TICK,ctr,label_value 110 LENGTH_OF_SCAN=1 @ NUMBER_OF_SAMPLES=200 @ NUMBER_OF_TICKS=10 120 SAMPLE_SIZE=LENGTH_OF_SCAN/NUMBER_OF_SAMPLES 130 AMP=1 @ TC=0.3 @ FREQ=10 140 X_TICK=LENGTH_OF_SCAN/NUMBER_OF_TICKS @ Y_TICK=AMP/(NUMBER_OF_TICKS/2) 150 ! 160 PEN 1 @ GCLEAR @ CSIZE 3 @ RAD @ LOCATE 20,180,20,80 @ FRAME 170 SCALE 0,LENGTH_OF_SCAN,-AMP,AMP @ AXES X_TICK,Y_TICK 180 ! 190 label_value=0 @ LDIR PI/2 @ LORG 8 ! Label the X-axis. 200 Label_X_Axis: 210 MOVE label_value,-AMP 220 LABEL USING "DZ.DD,K" ; label_value," " 230 label_value=label_value+X_TICK 240 IF label_value<=LENGTH_OF_SCAN THEN GOTO Label_X_Axis 250 ! 260 label_value=-AMP @ LDIR 0 @ LORG 8 ! Label the Y-axis. 270 Label_Y_Axis: 280 MOVE 0,label_value 290 IF ABS(label_value)