Finding the closer pixel.

To determine which pixel is closest to the line, we need to measure the distance of its center from the path of the line. For this example, we see that the lower pixel (shown as white in the slide) is the closer pixel. Because we are using an integer to approximate the actual y-coordinate of the line, we've created an error. The line's y-value lies above the integer approximation, so the error is a positive quantity

Back

Quit