This simple Java applet illustrates how 2-dimensional lines are represented
as discretized pixels on a computer screen. Each small box represents an
individual pixel. Simply click once to mark the beginning of the line, and then
click a second time to mark the end of the line.
This applet includes the following options:
- Grid Toggle - Clicking the Grid button toggles the grid on/off.
- Line Toggle - Clicking the Line button toggles the overlaid red
- Change Resolution - Clicking the +/- buttons increases or decreases
the resolution, respectively.
Take a look at the code.