Antialiasing

When antialiasing manually(shading with different intensity on, below and above the pixel), how to calculate the distance between the “true” line and the pixel?

This is a link to some great explanation:
http://freespace.virgin.net/hugo.elias/graphics/x_wuline.htm

Ciao,

Niftybitz.