Presentation is loading. Please wait.

Presentation is loading. Please wait.

CP = E[ s 2, s 5, s 1, s 3, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[] I[] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ Plane Sweep Algorithm.

Similar presentations


Presentation on theme: "CP = E[ s 2, s 5, s 1, s 3, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[] I[] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ Plane Sweep Algorithm."— Presentation transcript:

1 CP = E[ s 2, s 5, s 1, s 3, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[] I[] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ Plane Sweep Algorithm for Line-Segment Intersection Problem CP=Current PointE=Event Queue S=Status QueueI=Intersection List

2 Previous CP = E[ s 2, s 5, s 1, s 3, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ ] I[ ] New CP = s 2 E[ s 2, s 5, s 1, s 3, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 2 ] I[ ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’

3 New CP = s 5 E[ s 5, s 1, s 3, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 2, s 5 ] I[ ] Previous CP = s 2 E[ s 5, s 1, s 3, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 2 ] I[ ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ previous sweep line new sweep line Compare s 2 with s 5 => no intersection

4 New CP = s 1 E[ s 1, s 3, s 21, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 2, s 1, s 5 ] I[s 21 ] Previous CP = s 5 E[ s 1, s 3, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 2, s 5 ] I[ ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ Compare s `1 with s 2 => s 21 Compare s `1 with s 5 => no intersection s 21

5 New CP = s 3 E[ s 3, s 53, s 21, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 2, s 1, s 5, s 3 ] I[s 21, s 53 ] Previous CP = s 1 E[ s 3, s 21, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 2, s 1, s 5 ] I[s 21 ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ Compare s `3 with s 5 => s 53 s 21 s 53

6 New CP = s 53 E[ s 53, s 21, s 13, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 2, s 1, s 3, s 5 ] I[s 21, s 53, s 13 ] Previous CP = s 3 E[ s 53, s 21, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 2, s 1, s 5, s 3 ] I[s 21, s 53 ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ Compare s `3 with s 1 => s 13 s 21 s 53 s 13

7 New CP = s 21 E[ s 21, s 23, s 13, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 1, s 2, s 3, s 5 ] I[s 21, s 53, s 13, s 23 ] Previous CP = s 53 E[ s 21, s 13, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 2, s 1, s 3, s 5 ] I[s 21, s 53, s 13 ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ Compare s `2 with s 3 => s 23 s 21 s 53 s 13 s 23

8 New CP = s 23 E[ s 23, s 13, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 1, s 3, s 2, s 5 ] I[s 21, s 53, s 13, s 23 ] Previous CP = s 21 E[ s 23, s 13, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 1, s 2, s 3, s 5 ] I[s 21, s 53, s 13, s 23 ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ Compare s `3 with s 1 => s 13 (already in the list) s 21 s 53 s 13 s 23 Compare s `2 with s 5 => no intersection

9 New CP = s 13 E[ s 13, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 3, s 1, s 2, s 5 ] I[s 21, s 53, s 13, s 23 ] Previous CP = s 23 E[ s 13, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 1, s 3, s 2, s 5 ] I[s 21, s 53, s 13, s 23 ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ Compare s `1 with s 2 => s 21 (already in the list) s 21 s 53 s 13 s 23

10 New CP = s 2 ’ E[ s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 3, s 1, s 2, s 5 ] I[s 21, s 53, s 13, s 23 ] Previous CP = s 13 E[ s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 3, s 1, s 2, s 5 ] I[s 21, s 53, s 13, s 23 ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ Compare s `1 with s 5 => no intersection s 21 s 53 s 13 s 23

11 New CP = s 3 ’ E[ s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 3, s 1, s 5 ] I[s 21, s 53, s 13, s 23 ] Previous CP = s 2 ’ E[ s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 3, s 1, s 5 ] I[s 21, s 53, s 13, s 23 ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ s 21 s 53 s 13 s 23

12 New CP = s 4 E[ s 4, s 54, s 1 ’, s 4 ’, s 5 ’ ] S[ s 1, s 5, s 4 ] I[s 21, s 53, s 13, s 23, s 54 ] Previous CP = s 3 ’ E[ s 4, s 1 ’, s 4 ’, s 5 ’ ] S[ s 1, s 5 ] I[s 21, s 53, s 13, s 23 ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ s 21 s 53 s 13 s 23 Compare s `4 with s 5 => s 54 s 54

13 New CP = s 54 E[ s 54, s 1 ’, s 4 ’, s 5 ’ ] S[ s 1, s 4, s 5 ] I[s 21, s 53, s 13, s 23, s 54 ] Previous CP = s 4 E[ s 54, s 1 ’, s 4 ’, s 5 ’ ] S[ s 1, s 5, s 4 ] I[s 21, s 53, s 13, s 23, s 54 ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ s 21 s 53 s 13 s 23 Compare s `4 with s 1 => no intersection s 54

14 New CP = s 1 ’ E[ s 1 ’, s 4 ’, s 5 ’ ] S[ s 1, s 4, s 5 ] I[s 21, s 53, s 13, s 23, s 54 ] Previous CP = s 54 E[ s 1 ’, s 4 ’, s 5 ’ ] S[ s 1, s 4, s 5 ] I[s 21, s 53, s 13, s 23, s 54 ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ s 21 s 53 s 13 s 23 s 54

15 New CP = s 4 ’ E[ s 4 ’, s 5 ’ ] S[ s 4, s 5 ] I[s 21, s 53, s 13, s 23, s 54 ] Previous CP = s 1 ’ E[ s 4 ’, s 5 ’ ] S[ s 4, s 5 ] I[s 21, s 53, s 13, s 23, s 54 ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ s 21 s 53 s 13 s 23 s 54

16 New CP = s 5 ’ E[ s 5 ’ ] S[ s 5 ] I[s 21, s 53, s 13, s 23, s 54 ] Previous CP = s 4 ’ E[ s 5 ’ ] S[ s 5 ] I[s 21, s 53, s 13, s 23, s 54 ] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ s 21 s 53 s 13 s 23 s 54 Event Queue Is Empty, therefore STOP


Download ppt "CP = E[ s 2, s 5, s 1, s 3, s 2 ’, s 3 ’, s 4, s 1 ’, s 4 ’, s 5 ’ ] S[] I[] s1s1 s1’s1’ s2s2 s2’s2’ s4s4 s4’s4’ s3s3 s3’s3’ s5s5 s5’s5’ Plane Sweep Algorithm."

Similar presentations


Ads by Google