Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help for this The magic of hidden surface removal is that you can often com

ID: 3761836 • Letter: N

Question

Need help for this

The magic of hidden surface removal is that you can often compute things faster than your intuition suggests. Here’s a clean geometric example to illustrate a basic speed-up that can be achieved. You are given n non-vertical lines in the plane, labeled L1, ..., Ln, with the i th line specified by the equation y = aix + bi . We will make the assumption that no three of the lines all meet at a single point. We say line Li is uppermost at a given x-coordinate x0 if its y-coordinate at x0 is greater than the y-coordinates of all the other lines at x0 : aix0 + bi > ajx0 + bj for all j 6= i. We say line Li is visible if there is some x-coordinate at which it is uppermost—intuitively, some portion of it can be seen if you look down from “y = .” Give an algorithm that takes n lines as input, and in O(n log n) time returns all the visible ones and where they intersect.

Hint 1: Start by sorting the edges in order of increasing slope. Notice that the first and last lines in this order will always be visible. Hint 2: If two lines are both visible, the region in which the line of smaller slope is uppermost lies to the left of the region in which the line of larger slope is uppermost. Hint 3: When you combine two sub-solutions, consider each intersection point and consider which sub-solution has the uppermost line at this point.

Explanation / Answer

Probably the most common application of BSP trees is hidden surface removal in threedimensions. BSP trees provide a rich and beautiful, efficient method for sorting polygons via adepth first tree walk. This fact can be taken advantage of in a back to front "painter's set of computer instructions" approach to the visible surface problem, or a front to back scan-lineapproach.Given a set of n non-intersecting polygons in 3-space, imagine projecting these polygon onto a plane either orthogonally or using perspective . Determine which portions of the polygons are visible from the viewpoint under this projection. Note that in the worst case, the complexity of the final visible scene may be as high as O(n 2 ), so this is asymptotically optimal.

Here is a natural application of two things existing together and arrangements that turns out to be important
for the problem of figuring out/calculating visibility graphs. Think about/believe a set of n points in the plane. For each point p in
this set we want to perform a skinny so you can see bones having angles sweep, say in when a wheel turns so the top moves to the left order, visiting the other n a' 1 points of

the set. For each point, it is possible to figure out/calculate the angles between this point and the remaining n a' 1 points
and then sort these angles. This would take O(n log n) time per point, and O(n 2 log n) time overall.

With arrangements we can speed this up to O(n 2 ) total time, getting rid of the extra O(log n) factor. Here is how. Recall the point-line dual transformation. A point p = (px, py) and line ` : (y = ax b) in the primal plane are mapped through to a dual pointthen there is exactly one left bounding edge in `’s zone, and 1 3n. Assume that the hypothesis is true for any set of n1 lines. Consider the rightmost line of the arrangement to intersect `. Call this `1. (Selecting this particular line is very important for the proof.) Suppose that we consider the arrangement of the other n 1 lines. By the induction hypothesis there will be at most 3(n 1) left-bounding edges in the zone for `. Now let us add back `1 and see how many more left-bounding edges result. Consider the rightmost face of the arrangement of n 1 lines. Note that all of its edges are left-bounding edges. Line `1 will intersect ` within this face. Let ea and eb denote the two edges of this that `1 intersects, one above ` and the other below `. The insertion of `1 creates a new left bounding edge along `1 itself, and splits the left bounding edges ea and eb into two new left bounding edges for a net increase of three edges. Observe that `1 cannot contribute any other left-bounding edges to the zone, because depending on slope either the line supporting ea or the line supporting eb blocks `1’s visibility from `

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote