Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.

Slides:



Advertisements
Similar presentations
Two Segments Intersect?
Advertisements

Geometry Introduction
Polygon Triangulation
Spatial Information Systems (SIS) COMP Terrain modeling and geometric problems (part 2)
Computational Geometry
Line Segment Intersection. Balanced binary search tree Internal nodes: Rightmost leaf in its left subtree Status Structure T.
Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Brute-Force Triangulation
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
One of the most important problems is Computational Geometry is to find an efficient way to decide, given a subdivision of E n and a point P, in which.
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann Triangulation (Naive)
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
I. The Problem of Molding Does a given object have a mold from which it can be removed? object not removable mold 1 object removable Assumptions The object.
1 Voronoi Diagrams. 2 Voronoi Diagram Input: A set of points locations (sites) in the plane.Input: A set of points locations (sites) in the plane. Output:
Overlay of Two Subdivisions
Computational Geometry
Zoo-Keeper’s Problem An O(nlogn) algorithm for the zoo-keeper’s problem Sergei Bespamyatnikh Computational Geometry 24 (2003), pp th CGC Workshop.
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
Intersections. Intersection Problem 3 Intersection Detection: Given two geometric objects, do they intersect? Intersection detection (test) is frequently.
Lecture 3 Lower envelopes Computational Geometry, 2005/06 Prof.Dr.Th.Ottmann 1 The Lower Envelope The Pointwise Minimum of a Set of Functions.
November 4, Algorithms and Data Structures Lecture XIV Simonas Šaltenis Nykredit Center for Database Research Aalborg University
Computational Geometry Piyush Kumar (Lecture 3: Convexity and Convex hulls) Welcome to CIS5930.
Voronoi Diagram Presenter: GI1 11號 蔡逸凡
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
CS138A Line Segment Intersection Peter Schröder.
17. Computational Geometry Chapter 7 Voronoi Diagrams.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
Lecture 12 : Special Case of Hidden-Line-Elimination Computational Geometry Prof. Dr. Th. Ottmann 1 Special Cases of the Hidden Line Elimination Problem.
Special Cases of the Hidden Line Elimination Problem Computational Geometry, WS 2007/08 Lecture 16 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen,
Geometric Data Structures Computational Geometry, WS 2007/08 Lecture 13 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Hidden-Line Elimination Computational Geometry, WS 2006/07 Lecture 14 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Polygon Triangulation Computational Geometry, WS 2007/08 Lecture 9 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Lecture 11 : More Geometric Data Structures Computational Geometry Prof. Dr. Th. Ottmann 1 Geometric Data Structures 1.Rectangle Intersection 2.Segment.
Polygon Triangulation Computational Geometry, WS 2006/07 Lecture 8, Part 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Lection 1: Introduction Computational Geometry Prof.Dr.Th.Ottmann 1 History: Proof-based, algorithmic, axiomatic geometry, computational geometry today.
Brute-Force Triangulation
Advanced Algorithm Design and Analysis (Lecture 9) SW5 fall 2004 Simonas Šaltenis E1-215b
1 Geometric Intersection Determining if there are intersections between graphical objects Finding all intersecting pairs Brute Force Algorithm Plane Sweep.
9/7/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries Carola Wenk.
Triangulating a monotone polygon
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
14/13/15 CMPS 3130/6130 Computational Geometry Spring 2015 Windowing Carola Wenk CMPS 3130/6130 Computational Geometry.
2/19/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Voronoi Diagrams Carola Wenk Based on: Computational Geometry:
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part III Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für.
CMPS 3130/6130 Computational Geometry Spring 2015
Computational Geometry: Intersection Search Joseph S. B. Mitchell Stony Brook University.
1/29/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries Carola Wenk.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
1/20/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Plane Sweep Algorithms I Carola Wenk.
Polygon Triangulation
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
CMPS 3130/6130 Computational Geometry Spring 2017
CMPS 3130/6130 Computational Geometry Spring 2017
Computational Geometry 2
Computational Geometry Capter:1-2.1
I. The Problem of Molding
CMPS 3130/6130 Computational Geometry Spring 2017
Overlay of Two Subdivisions
Presentation transcript:

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

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 2 Line segment intersection Input: Set S = {s 1...,s n } of n closed line segments s i ={(x i, y i ), (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 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 3 Sweep line principle Event queue: upper, lower, intersection points Status structure: Ordered set of active line segments

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 4 Example: Segment Intersection A D C B E A C D C E B A D QT E B

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 5 Data structures: Event Queue Q Operations: Initialisation (sequence of upper and lower endpoints of segments in decreasing y-order), min-delete, insertion (of intersection points) Implementation: Balanced search tree with order p < q  p y < q y or (p y = q y and p x < q x ) Space: O(n + k), k = #intersections Time:Initialisation: O(n log n) Min-delete: O(log n) Insertion: O(log n)

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 6 Data structures: Status structure T Balanced search tree k m i i j l l jk i j k l m Operations: insertion, deletion, neighbor search, (changing order) Space: O(n) Time: O(log n)

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 7 Number of operations, total time n = #segments k = #intersections Number of operations on event queueQ: <= 2n+k, Number of operations on status structureT: <= 2n+k Result: Total time required to carry out the sweep-line algorithm for computing all k intersections in a set of n line segments is O((n+k) log n). The sweep-line algorithm is output sensitive!

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 8 A simple neighborhood lemma Lemma : Let s i and s j be two non-horizontal segments intersecting in a single point p and no third segment passing through p. Then there is an event point above p where s i and s j become adjacent and are tested for intersection. L p sisi sjsj Proof : L is so close to p that s i and s j are next to each other. Since s i and s j are not yet adjacent at the beginning of the algorithm there is an event q where s i and s j become adjacent and tested for intersection.

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 9 Handling special cases P L

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 10 Special cases I L(P) C(P) P L

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 11 Special cases II U(P) C(P) P L

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 12 HandleEventPoint(p) if ( L(p)  U(p)  C(p) contains more than 1 segment) then {report p as intersection; delete L(p)  C(p) from T; insert U(p)  C(p) into T;} if ( U(p)  C(p) = {} ) then {Let s l and s r be left and right neighbours of p in T FindNewEvent(s l,s r,p) else s´ = leftmost segment of U(p)  C(p) in T s l = left neighbour of s´ in T FindNewEvent(s l,s´,p) s´´ = rightmost segment of U(p)  C(p) s r = right neighbour of s´´ in T FindNewEvent(s´´,s r,p)

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 13 FindNewEvent(s,s´,p) If (s and s´ intersect below the sweep line L or on it and to the right of the current event point p) and (the intersection of s and s´is not yet present in Q) then insert the intersection point into Q;

Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 14 Summary Theorem: Let S be a set of n line segments in the plane. All intersection points in S, with for each intersection point the segments involved in it, can be reported in O(n log n + k log n) time and O(n) space, where k is the size of the output.. k can be reduced to I, I = #intersections