Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection • Motivation: Computing the overlay of several maps • The Sweep-Line-Paradigm: A visibility problem • Line Segment Intersection • The Doubly Connected Edge List • Computing boolean operations on polygons
Line Segment Intersection. M otivation: Computing the overlay of several maps The Sweep -Line-P aradigm: A visibility problem L ine S egment Intersection The D oubly Connected E dge L ist Computing boolean operations on p olygon s. Maps. river. road. overlaid maps. - PowerPoint PPT Presentation
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Lecture 2Line Segment Intersection
Computational GeometryProf.Dr.Th.Ottmann
1
Line Segment Intersection
• Motivation: Computing the overlay of several maps
• The Sweep-Line-Paradigm: A visibility problem
• Line Segment Intersection
• The Doubly Connected Edge List
• Computing boolean operations on polygons
Lecture 2Line Segment Intersection
Computational GeometryProf.Dr.Th.Ottmann
2
Maps
Lecture 2Line Segment Intersection
Computational GeometryProf.Dr.Th.Ottmann
3
Motivation
Thematic map overlay in Geographical Information Systems
roadriver overlaid maps
1. Thematic overlays provide important information.
2. Roads and rivers can both be regarded as networks of line segments.
Lecture 2Line Segment Intersection
Computational GeometryProf.Dr.Th.Ottmann
4
Problem definition
Input: Set S = {s1...,sn } of n closed line segments si={(xi, yi), (x´i, y´i)}
•
• • •
• • •
•
• •
Output: All intersection points among the segments in S
The intersection of two lines can be computed in time O(1).
Lecture 2Line Segment Intersection
Computational GeometryProf.Dr.Th.Ottmann
5
Naive algorithm
Goal: Output sensitive algorithm!
Lecture 2Line Segment Intersection
Computational GeometryProf.Dr.Th.Ottmann
6
The Sweep-Line-Paradigm: A visibility problem
Input: Set of n vertcal line segmentsOutput: All pairs of mutually visible segments
AB
C
D
E
FG
H
Naive method:
Observation: Two line segments s and s´are mutually visible iffthere is a y such that s and s´are immediateneighbors at y.
Lecture 2Line Segment Intersection
Computational GeometryProf.Dr.Th.Ottmann
7
Sweep line algorithmQ is set of the start and end points of the segments in decreasing y-order