All spans are contained by a wedge. Wedges that don't overlap can be easily sorted. A sector is a wedge of a circle containing a range of points. -X +X -Y +Y X > 0>  Y > 0    Y < X X < 0   Y > 0   -Y < X X < 0   Y < 0    Y < X Line spans are contained by a single sector. X > 0   Y < 0   -Y < X X > 0   Y < 0   -Y > X X < 0   Y < 0    Y < X X < 0   Y < 0    Y > X X < 0   Y > 0   -Y < X X < 0   Y > 0   -Y < X X > 0   Y > 0    Y > X X > 0   Y > 0    Y < X A curve span may cover more than one sector. Some lines occupy one-dimensional sectors. X > 0   Y == 0 Y > 0   0 == X X < 0   Y == X Some curves initially occupy one-dimensional sectors, then diverge. Each sector is assigned a number. Each span has a bit set for one or more sectors. Span sets allow rough sorting without angle computation.