6.838, Computational Geometry; Fall 2001
Point Location
Sergi Elizalde & David Pritchard
Finding Intersected Trapezoids
How is a new segment si added?
Let D0, D1,...,Dk be the trapezoids intersected by si, ordered from left to right.
D0 is the trapezoid containing the left endpoint p of si. To find it, perform a query on D (the data structure corresponding to the segments inserted so far) with p. We have to be careful if p was already present as an endpoint (assume the new point is slightly to the right).
Dj+1 must be a right neighbor of Dj, and it is easy to determine which one: If rightp(Dj) lies above si, then Dj+1 is the lower right neighbor of Dj, otherwise it is its upper right neighbor.
Update T and D.