Digital Differential Analyzer is a scan conversion line algorithm based on calculating either dy or dx. We sample the line at unit intervals in one coordinate & determine corresponding integer values nearest to the line path for the other coordinate.
The algorithm accepts as input the two endpoint pixel positions. Horizontal & vertical differences between the endpoint positions are assigned to parameters dx & dy. The difference with the greater magnitude determines the increment of the parameter steps. Starting with the pixel position (xa , ya), we determine the offset needed at each step to generate the next pixel position along the line path.