Implementation Idea

 [Previous Chapter]  [Previous Page]  [Contents]  [Next Page]  [Next Chapter]

*Let f(x) be a real-valued function that is defined in the interval of [x0x1) and which holds y0   <=   f(x)   <=   y1   V   x   E   [x0x1).
 
*The selected rectangular area specified by x0, x1, y0, and y1 can be mapped linearly to a two-dimensional array (called canvas) of characters. The larger the array, the smaller the granularity.
 
*To graph the function, we can evaluate it at those values of x that correspond to the individual columns of the canvas and store some character (other than space) at the row of the column that corresponds to y   =   f(x).
 
*Finally, we can output the canvas by printing the first row on the first line, the second row on the second line etc.
 

 [Previous Chapter]  [Previous Page]  [Contents]  [Next Page]  [Next Chapter]
Copyright © 2001, 2002 Andreas Borchert, converted to HTML on February 11, 2002