Graphics / Reference / First-octant assumption
First-octant assumption
The initial line-rasterisation algorithms are restricted to shallow lines that move left to right and upward. This first-octant case has x0 < x1 and slope 0 <= m <= 1.
The initial line-rasterisation derivations assume a segment from endpoint (x0,y0) to endpoint (x1,y1).
The restricted case is the first octant:
x0 < x1
0 <= m <= 1
where m = (y1 - y0)/(x1 - x0).
These conditions mean that the line proceeds from left to right, never decreases in y, and rises by at most one unit for every unit increase in x. It is therefore a shallow rising line.
This restriction makes x a convenient driving coordinate: an algorithm can advance one column at a time, while the selected y row either remains the same or increases by at most one in the simple first-octant case.
The standard diagram shows (x0,y0) at the lower-left, (x1,y1) at the upper-right, and a shallow rising segment crossing the pixel grid. Other octants require corresponding changes in direction or in which coordinate drives the rasterisation.
Builds on
Read
- Read the chapter: First-octant assumption