Computational Geometry

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

Two Segments Intersect?
Geometry Introduction
Polygon Triangulation
Spatial Information Systems (SIS) COMP Terrain modeling and geometric problems (part 2)
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Supplementary Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut.
Polygon overlay in double precision arithmetic One example of why robust geometric code is hard to write Jack Snoeyink & Andrea Mantler Computer Science,
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.
Convex Hull obstacle start end Convex Hull Convex Hull
CS16: Introduction to Data Structures & Algorithms
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:
Advanced Topics in Algorithms and Data Structures Lecture 7.1, page 1 An overview of lecture 7 An optimal parallel algorithm for the 2D convex hull problem,
Computational Geometry
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.
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.
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.
N Line Segments Problem Given a set of n line segments in the plane, determine whether or not any intersection exists. It is not required to output all.
6/2/ :35 AMIncremental Convex Hull1 q w u e zt.
Line Segment Intersection Computational Geometry, WS 2007/08 Lecture 3 – Part I Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
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,
Computational Geometry Overview from Cormen, et al. Chapter 33
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.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Voronoi Diagrams.
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.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Brute-Force Triangulation
Orthogonal Line Segment Intersection Given N horizontal and N vertical line segments, find all intersections. All x and y coordinates are distinct.
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.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
1 Triangulation Supplemental From O’Rourke (Chs. 1&2) Fall 2005.
2/19/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Voronoi Diagrams Carola Wenk Based on: Computational Geometry:
CMPS 3130/6130 Computational Geometry Spring 2015
Computational Geometry: Intersection Search Joseph S. B. Mitchell Stony Brook University.
UNC Chapel Hill M. C. Lin Computing Voronoi Diagram For each site p i, compute the common inter- section of the half-planes h(p i, p j ) for i  j, using.
Lecture 15 Computational Geometry Geometry sweeping Geometric preliminaries Some basics geometry algorithms.
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
Computational Geometry
Introduction to Data Structure and Algorithms
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
Line Sweep Algorithms Schalk-Willem Krüger – 2009 Training Camp 1 presentation.start();
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
Geometric Data Structures
CMPS 3130/6130 Computational Geometry Spring 2017
Algorithm design techniques Dr. M. Gavrilova
CMPS 3130/6130 Computational Geometry Spring 2017
Orthogonal Range Searching and Kd-Trees
Computational Geometry Capter:1-2.1
I. The Problem of Molding
Heaps By JJ Shepherd.
CS 113: Data Structures and Algorithms
Algorithms and Data Structures Lecture XIV
Presentation transcript:

Computational Geometry Hwangryol Ryu Dongchul Kim

Computational Geometry Intersection of line segment Basic geometric objects Point : ( x, y ) Line : {(x1,y1) , (x2,y2) } Line segment : size of line is given (x2,y2) (x2,y2) (x1,y1) (x1,y1)

Basic geometric objects(contd) Polygon Convex Non-convex Convex : Each indegree less than 180

Intersection of line segment Input : a pair of line segments Output : yes – if they intersect no – otherwise How do we know that intersection(x,y) exits between two lines? (x, y)

Intersection of line segment(…contd) Algorithm Find equation of first segment Y=m1x+c1 Find equation of second segment Y=m2x+c2 Find intersection of two lines : (x,y) If ( x1 < x < x2 ) && ( x3 < x < x4 ) Then return (Intersection exits) Else return (No intersection exits) (x2,y2) (x1,y1) (x, y) (x3,y3) (x4,y4)

Intersection of line segment(…contd) Is there a pair of line segments intersecting each other? Naive algorithm: Check each two segments for intersection. Complexity: O(n2).

Plane Sweep – Algorithm Event is any end point or intersection point. Sweep the plane using a vertical line. Maintain two data structures: Event priority queue – sorted by x coordinate. Sweep line status – Stores segments currently intersected by sweep line and maintain Red-Black Tree to support data structure.

Plane Sweep – Algorithm Problem: Given n segments in the plane, compute all their intersections. Assume: No line segment is vertical. No two segments are collinear. No three segments intersect at a common point. Event is any end point or intersection point. Sweep the plane using a vertical line. Maintain two data structures: Event priority queue – sorted by x coordinate. Sweep line status – Stores segments currently intersected by sweep line, sorted by y coordinate.

Plane Sweep - Basic Idea We are able to identify all intersections by looking only at adjacent segments in the sweep line status during the sweep. Theorem: Just before an intersection occurs, the two relevant segments are adjacent to each other in the sweep line status.

Plane Sweep - Basic Idea(contd) In practice: Look ahead: whenever two line segments become adjacent along the sweep line, check for their intersection to the right of the sweep line.

Plane Sweep – Algorithm Initialization: Add all segments’ endpoints to the event queue (O(n log n)). Sweep line status is empty. Algorithm proceeds by inserting and deleting discrete events from the queue until it is empty.

Plane Sweep – Algorithm Event A: Beginning of segment Insert segment into sweep line status. Test for intersection to the right of the sweep line with the segments immediately above and below. Insert point (if found) into event queue. Complexity: n such events, O(log n) each  O(n log n) total.

Plane Sweep – Algorithm Event B: End of segment Delete segment from sweep line status. Test for intersection to the right of the sweep line between the segments immediately above and below. Insert point (if found) into event queue. Complexity: n such events, O(log n) each  O(n log n) total.

Plane Sweep – Algorithm Event C: Intersection point Report the point. Swap the two line relevant segments in the sweep line status. For the new upper segment – test it against its predecessor for an intersection. Insert point (if found) into event queue. Similar for new lower segment (with successor). Complexity: k such events, O(logn) each  O(klogn) total.

Plane Sweep – Example Ex1) s3 e1 s4 s2 s1 s0 Sweep Line Status b4 Ex1) s3 e1 s4 a2 a4 b3 s2 b1 b0 s1 b2 s0 a1 a0 Sweep Line Status Event Queue s0,s1,s2,s3 a4, b1, b2, b0, b3, b4

Plane Sweep – Example s3 e1 s4 s2 s1 s0 Insert s4 to SLS b4 s3 e1 s4 a2 a4 b3 s2 b1 b0 s1 b2 s0 a1 a0 Insert s4 to SLS Test s4-s3 and s4-s2. Add e1 to EQ s0,s1,s2, s4, s3 b1, e1, b2, b0, b3, b4 Action Sweep Line Status Event Queue

Plane Sweep – Example s3 e1 s4 s2 e2 s1 s0 Delete s1 from SLS Action b4 s3 e1 s4 a2 a4 b3 s2 e2 b0 s1 b1 b2 s0 a1 a0 Delete s1 from SLS Test s0-s2. Add e2 to EQ s0,s2,s4,s3 e1, e2, b2, b0, b3, b4 Action Sweep Line Status Event Queue

Plane Sweep – Example s3 e1 s4 s2 e2 s1 s0 Swap s3 and s4 . Action b4 s3 e1 s4 a2 a4 b3 s2 e2 b0 s1 b1 b2 s0 a1 a0 Swap s3 and s4 . Test s3-s2. s0,s2,s3,s4 e2, b2, b0, b3, b4 Action Sweep Line Status Event Queue

Plane Sweep – Complexity Analysis Total time complexity: O((n+k) logn). If kn2 this is almost like the naive algorithm. Event queue: heap Sweep line status: balanced binary tree Total space complexity: O(n+k).