Line 250 starts a loop to calculate the points on the curve. Since BASIC uses radian measure for angles, the value of ANGLE goes from 0 to just over 360 degrees, slightly more than a full circle (to ensure that there is no gap at the end). The step value must be small enough that the curve appears smooth, and not as a series of straight lines.
Lines 260 and 270 calculate the X and Y coordinates of each point on the curve (X2 and Y2).
The routine in lines
Line 310 calculates the horizontal and vertical projected lengths of the line. Lines 320 and 330 calculate the number of steps required in each direction so that no dots are missed. Line 340 selects the larger number of steps to use in plotting the line. Line 350 skips the rest of the routine if no steps are required.
Line 360 calculates the change in the X and Y coordinates for each step, and line 370 starts a loop to plot the points.
Line 380 advances the position of point Xl, Yl along the line to be plotted, using the rates of change calculated in line 360. Line 420 relates the point Xl, Yl to the actual dot coordinates. Lines 430 and 440 calculate the element in the array BUFFER%( ) that is to be changed, and line 450 determines which bit is to be set.
Line 460 turns on a particular dot in the array in memory. The selected element of the array is OR’ed with the value of the pin that is to print (contained in the vector array DOT%( )). The OR function is used to prevent problems in the case of the same dot being set twice.
The procedure for creating printing dots is repeated for the length of the line, and then the value of ANGLE is incremented and the procedure is repeated until the figure is complete.
82