Rasterisation is the computation of the set of pixels that a shape covers; a pixel is covered by a triangle when its centre is inside the triangle. The edge function of the directed edge from to is
twice the signed area of the triangle ; it is zero on the line and has opposite signs on its two sides. The top-left rule decides the centres that lie exactly on an edge: such a centre is drawn only if the edge is a top edge, horizontal with the triangle below it, or a left edge, with the triangle to its right.