A Sweepline Program
Load PQ with segment-start and segment-end events;
loop
Get next event from PQ;
if (intersection) then Report it;
Update sweepline;
Check for new adjacencies;
If two segments are newly adjacent and they intersect then
Insert their intersection-event into the PQ;
end loop;
CS409 - Spring 2000
5