COSC 6114 Prof. Andy Mirzaian Computational Geometry.

Slides:



Advertisements
Similar presentations
Order-k Voronoi Diagram in the Plane
Advertisements

Computational Geometry The systematic study of algorithms and data structures for geometric objects, with a focus on exact algorithms that are asymptotically.
CSE 4101/5101 Prof. Andy Mirzaian Computational Geometry.
CSE 4101/5101 Prof. Andy Mirzaian. References: Lecture Note 8 [LN8]LN8 [CLRS] chapter 33 Lecture Note 8 [LN8]LN8 [CLRS] chapter 33 Applications:  Proximity.
TEL-AVIV UNIVERSITY FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric Average of Two Simple Polygons.
Problems in curves and surfaces M. Ramanathan Problems in curves and surfaces.
Comments We consider in this topic a large class of related problems that deal with proximity of points in the plane. We will: 1.Define some proximity.
Approximations of points and polygonal chains
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
 Distance Problems: › Post Office Problem › Nearest Neighbors and Closest Pair › Largest Empty and Smallest Enclosing Circle  Sub graphs of Delaunay.
Proximity graphs: reconstruction of curves and surfaces
EECS 4101/5101 Prof. Andy Mirzaian. References: [M. de Berge et al ’00] chapter 3 [Preparata-Shamos’85] chapter 6 [O’Rourke’98] chapter 1 [M. de Berge.
Convex Hull obstacle start end Convex Hull Convex Hull
CS16: Introduction to Data Structures & Algorithms
Krakow, Summer 2011 Schnyder’s Theorem and Relatives William T. Trotter
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:
The Divide-and-Conquer Strategy
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
Tools from Computational Geometry Bernard Chazelle Princeton University Bernard Chazelle Princeton University Tutorial FOCS 2005.
By Groysman Maxim. Let S be a set of sites in the plane. Each point in the plane is influenced by each point of S. We would like to decompose the plane.
Classes of Polygons Planar polygons Non-planar polygons Simple
Convex Hulls in 3-space Jason C. Yang.
Convex Hull Problem Presented By Erion Lin. Outline Convex Hull Problem Voronoi Diagram Fermat Point.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
What does that mean? To get the taste we will just look only at some sample problems... [Adapted from S.Suri]
Sasha Vasserman.  Two triangles are similar if two pairs of corresponding angles are congruent.
Voronoi Diagram Presenter: GI1 11號 蔡逸凡
Computational Geometry -- Voronoi Diagram
17. Computational Geometry Chapter 7 Voronoi Diagrams.
3. Delaunay triangulation
Delaunay Triangulation Computational Geometry, WS 2006/07 Lecture 11 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
1 Lecture 8: Voronoi Diagram Computational Geometry Prof. Dr. Th. Ottmann Voronoi Diagrams Definition Characteristics Size and Storage Construction Use.
By Eyal Dushkin [Ed] Chapter 1. I. Introduction Reminder – Voronoi Diagrams  Let S be a set of sites in the plane.  Each point in the plane.
TU/e computational geometry introduction Mark de Berg.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Chapter 5: Voronoi Diagrams Wednesday,
Duality and Arrangements Computational Geometry, WS 2007/08 Lecture 6 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Lecture 10 : Delaunay Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Overview Motivation. Triangulation of Planar Point Sets. Definition.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 9 Delaunay Triangulation.
Voronoi Diagrams and Delaunay Triangulations Generalized spaces and distances.
Lecture 8 : Arrangements and Duality Computational Geometry Prof. Dr. Th. Ottmann 1 Duality and Arrangements Duality between lines and points Computing.
UNC Chapel Hill M. C. Lin Overview of Last Lecture About Final Course Project –presentation, demo, write-up More geometric data structures –Binary Space.
Computing the Delaunay Triangulation By Nacha Chavez Math 870 Computational Geometry; Ch.9; de Berg, van Kreveld, Overmars, Schwarzkopf By Nacha Chavez.
Chapter 4: Straight Line Drawing Ronald Kieft. Contents Introduction Algorithm 1: Shift Method Algorithm 2: Realizer Method Other parts of chapter 4 Questions?
Voronoi Diagrams.
Duality and Arrangements Computational Geometry, WS 2006/07 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
UNC Chapel Hill M. C. Lin Point Location Chapter 6 of the Textbook –Review –Algorithm Analysis –Dealing with Degeneracies.
Delaunay Triangulations Presented by Glenn Eguchi Computational Geometry October 11, 2001.
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
Planar Graphs Graph G is planar, if it can be “properly” drawn in the plane. In order to explain this informal notion we have to define embeddings of graphs.
What can we do without using similarity and congruency?
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.
Planning Near-Optimal Corridors amidst Obstacles Ron Wein Jur P. van den Berg (U. Utrecht) Dan Halperin Athens May 2006.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
5 -1 Chapter 5 The Divide-and-Conquer Strategy A simple example finding the maximum of a set S of n numbers.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
TEL-AVIV UNIVERSITY RAYMOND AND BEVERLY SACKLER FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
Arrangements and Duality Sanjay Sthapit Comp290 10/6/98.
1 11. Polygons Polygons 2D polygons ( 다각형 ) –Polygon sides are all straight lines lying in the same plane 3D polyhedra ( 다면체 )  chap. 12 –Polyhedra.
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
1 Point Location Strategies Idit Haran
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 O’Rourke Chapter 6 with some material.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 9 Line Arrangements.
CENG 789 – Digital Geometry Processing 03- Point Sets Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.
An Introduction to Computational Geometry: Arrangements and Duality Joseph S. B. Mitchell Stony Brook University Some images from [O’Rourke, Computational.
COMPUTATIONAL GEOMETRY INTRODUCTION AND CONVEX HULLS ZAHRA NILFOROUSHAN ELECTRICAL & COMPUTER ENGINEERING DEPARTMENT, FACULTY OF ENGINEERING, KHARAZMI.
CMPS 3130/6130 Computational Geometry Spring 2017
Computational Geometry (35/33)
Computational Geometry
Presentation transcript:

COSC 6114 Prof. Andy Mirzaian Computational Geometry

TOPICS Course Overview Geometric Preliminaries Simple Polygons

Overview

Computational Geometry: Study of algorithms, data structures, and computational complexity of computational problems in geometry. Dimension: 1 2 3 … d … Objects: Finitely specifiable points lines ( line segments, rays, oriented, …) circles ( conics ) polygons … Computational Model & Primitive operations: real-RAM (Random Access Machine with exact real arithmetic) Arithmetic: + -   Comparison: = < >   Logic: not and or other:  sin cos … ( as little as possible)

Landscape of Computational Geometry Applications: Graphics Robotics Vision GIS CAD VLSI Pattern Recognition Optimization Transportation Statistics . . . Algorithmic Tools: general incremental divide-&-conquer space sweep topological sweep prune and search random sampling locus approach multidimensional search dynamization . . . Data Structures: general interval trees range trees segment trees priority search trees K-d trees fractional cascading persistent D.S. . . . Analysis Tools: general amortization Davenport-Schinzel . . . Geometric Tools: Convex Hull Space subdivision Arrangements Voronoi / Delaunay Diagram Triangulations Geometric Transforms Duality . . . Implementation Issues: Degeneracy (symbolic perturbation) Robustness (inexact arithmetic) . . .

Example 1: Convex Hull

Example 1: Convex Hull

Example 2: Point set triangulation

Example 2: Point set triangulation

Example 3: Simple Polygon Polygon: A closed curve in the plane consisting of finitely many straight segments. Simple Polygon: A connected non-self-crossing polygon. Convex Polygon: A simple polygon with no interior angle exceeding 180°. Simple Non-simple Convex Simple

Example 3: Simple Polygon Triangulation

Example 4: Planar Line Arrangement

Example 4: Planar Line Arrangement

Example 5: Voronoi Diagram & Delaunay Triangulation

Example 5: Voronoi Diagram & Delaunay Triangulation Nearest site proximity partitioning of the plane

Example 5: Voronoi Diagram & Delaunay Triangulation Delaunay Triangulation = Dual of the Voronoi Diagram.

Example 5: Voronoi Diagram & Delaunay Triangulation Delaunay triangles have the “empty circle” property.

Example 5: Voronoi Diagram & Delaunay Triangulation

Example 6: 2D Delaunay Triangulation via 3D Convex Hull z z=x2+y2 y x

Example 7: Hidden Surface Removal B B Applications: Graphics Multi-window user systems …

Example 8: Planar Graph Drawing Koebe-Andreev-Thurston’s Circle Packing Theorem: [1] Any planar graph can be drawn in the plane with vertices as centers of non-overlapping circles, such that  edge between two vertices  the two circles touch. Applications: CAD, VLSI, Graphics, …

Geometric Preliminaries

Metric Space (S,d) S = a set of objects called “points” of the space, d: S2   called the distance metric Metric Axioms: (x,y,z  S) d(x,y)  0 (non-negativity) d(x,y) = 0  x=y (positive definiteness) d(x,y) = d(y,x) (symmetry) d(x,y) + d(y,z)  d(x,z) (triangle inequality)

d = d-dimensional real space is the set of d-vectors x=(x1,x2, … ,xd)d, xi   (for i=1..d). d forms a vector space, i.e., it is closed under: scaling: x = (x1, x2, … ,xd)  d , . addition: x+y = (x1+y1, x2+y2, … , xd+yd)  d. x3 3 x1 x2

Normed space x , x  0 (with equality  x=0) x , y = y , x Inner product of two vectors x and y: x , y  . x , x  0 (with equality  x=0) x , y = y , x  x , y =  x , y = x , y Norm of a vector x: ||x|| = x , x ½ . Distance between vectors x,y: d(x,y) = || x – y || ||.|| is a metric norm if d(x,y) = || x – y || forms a metric. Example: dot-product x , y = xTy = x1y1+ x2y2+ … + xdyd defines Euclidean norm ||x|| = (|x1|2 + |x2|2 + … + |xd|2)1/2

Unit Ball of Norm: Unit Ball of the norm ||.|| is B = { xd | ||x||  1} & satisfies: B is symmetric about the origin, i.e., xB  -xB. B is convex B is closed, bounded, and has nonempty interior. Conversely, norm can be defined in terms of the unit ball: ||x|| = min {   0 | x  B } B = { y | yB } B B x ||x||= -1x O

Minkowski Metric Lp (1  p  ) || x ||p = (|x1|p + |x2|p + … + |xd|p)1/p dp(x,y) = || x-y ||p = (|x1 –y1|p + … + |xd –yd|p)1/p Example: L2 : (Ed : Euclidean) ||x||2 = (|x1|2 + |x2|2 + … + |xd|2)1/2 L1 : (Manhattan) ||x||1 = (|x1| + |x2| + … + |xd|) L : ||x|| = max { |x1| , |x2| , … , |xd| }

Unit Ball of Minkowski Metric Lp 2 p=3 p=2 p=1 Minkowski metric is indeed a metric: The triangle inequality is known as the Minkowski inequality [1] It is obtained from the Holder inequality [2]

Linear, affine & convex combinations points q1 , q2 , … , qk  d coefficients 1 , 2 , … , k   Linear combination: p = i iqi = 1q1+2q2+ … +kqk (this is a vector sum) Affine combination: p = i iqi = 1q1+2q2+ … +kqk s. t. i i =1 Convex combination: p = i iqi = 1q1+2q2+ … +kqk s. t. i i =1 & i0

Example: d=3, k=2 x3 q1 3 q2 Linear combinations: span(q1,q2) = {1q1+2q2 | 1 ,2  } = plane(O,q1,q2) Affine combinations: aff(q1,q2) = { q1+(1-)q2 |  } = line q1q2 Convex combinations: conv(q1,q2) = { q1+(1-)q2 | 0    1 } = line segment q1q2 conv(q1,q2,q3) = triangle q1q2q3 O x2 x1 >1 =1 q1 =0 0    1 q2 <0 q1 p q3 q2 r

-test: consider 3 points pi = (xi,yi)2, i=1,2,3  > 0  (p1 p2 p3 ) counter-clockwise (CCW), i.e., left turn  < 0  (p1 p2 p3 ) clockwise (CW), i.e., right turn  = 0  (p1 p2 p3 ) collinear ½ |  | = area of triangle (p1 p2 p3)

-test in higher dimensions: Consider d+1 points pi = (xi1,…,xid)  d, i=1..d+1. || /d! = volume of d-simplex (p1 ,p2 …,pd+1). sign() = orientation of d-simplex (p1 ,p2 …,pd+1).

Some applications of -test Polar angle comparison: (0i<) 1  2  (O,p1,p2)  0 [no need to compute trigonometric functions] p1 p2 O 1 2 p r1 r2 q In-sector test: q sector(p,r1,r2)  q is left of r1 and right of r2. (assume r2 is CCW from r1 about p.) p1 q1 p2 q2 Open line-segment crossing: p1p2  q1q2    (p1,p2,q1)  (p1,p2,q2) < 0 and (q1,q2,p1)  (q1,q2,p2) < 0 Cont’d

4. Line equation in 2D (ax+by+c=0) (x,y) collinear points (x2,y2) (x1,y1) (y1 - y2) x – (x1- x2) y + x1 y2 - x2 y1 = 0 a b c Some special cases: non-vertical (b0; divide by b): y = x +  vertical (a0, b=0; divide by a): x = 

Simple Polygons

Area of a simple polygon P=(p1,p2, …, pn) Algebraic area A(P) A(P) > 0 if P is CCW, A(P) < 0 if P is CW Geometric area Area(P) = |A(P)| FACT: 2A(P) =  (O, pi ,pi+1) =  (xi yi+1 – xi+1 yi ) =  xi(yi+1 – yi-1) O pi pi+1 P x y i=1 n (where O = origin, pn+1 = p1 , p0 = pn )

Jordan Curve Jordan Curve Theorem: Jordan Curve: a connected non-self-crossing closed curve in the plane. Jordan Curve Theorem: Any Jordan curve J partitions the plane into two regions, and J is their common boundary. The bounded region is called the interior of J. The unbounded region is called the exterior of J.

Point in Polygon Inclusion Problem Input: Simple n-gon P & query point q. Query: Is q inside P? P q

Point in Polygon Inclusion Problem In O(n) time shoot a ray out of q and count “proper” boundary crossings with P. P q

Point in Polygon Inclusion Problem In O(n) time shoot a ray out of q and count “proper” boundary crossings with P. P q

Point in Polygon Inclusion Problem Degenerate cases: How to count if ray passes through a vertex of the polygon? q q Answer: implicit and slight ray perturbation:

Point in Polygon Inclusion Problem Can we solve the problem in sub-linear time if P is convex? Answer: Yes, in O(log n) time by “binary Search”. p1 p2 pn pn-1 Step 1: Is q in sector p1 pn pn-1? If not, then return “outside” pn p1 pn-1 (O(1) time. Use -test.) Step 2: Binary search. q is in sector pi pn pj, 0<i<j<n. Let m =  (i+j)/2. Is q to the left of pnpm? Update i or j to m accordingly. Repeat until j=i+1. (O(log n) time.) pi pj pm pn Step 3: j=i+1. q is inside P  qpn does not cross pip i+1 . (O(1) time.) pi pi+1 pn q

Exercises Recommendation: Make a genuine effort on every exercise in this and the remaining Lecture Slides. They will reinforce your learning and induce a deeper level of understanding and mastery of the material. Virtually all of your assignment questions and some of the test-exam questions may come from these sets of exercises.

Show the following relationships hold for Minkowski norms in the plane: In general, how do these Minkowski norms compare in d ? [See the slides on Linear Programming for a more general result.] We are given a triangle T =  t1, t2, t3  by its 3 vertices in counter-clockwise order and a query point q, all in the plane. Give a simple O(1) time test to determine whether T contains q (inside or on its boundary). [Simplify your test “formula” as much as you can.] We are given a sequence P =  p1, p2, … , pn  of n points in the plane purported to be the vertices of a convex polygon in counter-clockwise order around its boundary. Give an efficient verification algorithm that P indeed represents such a polygon. We are given a convex polygon P with n vertices. Devise efficient algorithms to find (a) the largest circle inside P, (b) the largest axis-parallel square inside P, (c) the largest arbitrarily oriented square inside P. [Revisit this after we study Voronoi Diagrams and Delaunay Triangulations.] For Problem 4 see CACM Vol. 53, No. 5 & 6, 2010.

Let P be a given simple polygon with n vertices and q a given point inside P. For an arbitrary ray r that emanates from q, let CN(r, q, P) denote the crossing number of r, i.e., the number of edges of P crossed by ray r. Define Depth(q, P) to be the minimum CN(r, q, P) over all rays r emanating from q. Devise an efficient algorithm to compute Depth(q,P). Let P be an arbitrary simple polygon. (a) Show that there exists a square S that contains P and all 4 sides of S touch P. (A corner of S belongs to its both incident sides.) [Hint: the smallest bounding box of P at an arbitrary rotational orientation is a rectangle. We want a square. Continuously rotate the bounding box.] (b) Prove or disprove: there exists a square with all 4 corners on P. [This is hard.] For Problem 4 see CACM Vol. 53, No. 5 & 6, 2010.

We are given a set S of n pairwise disjoint line-segments in the plane We are given a set S of n pairwise disjoint line-segments in the plane. A J-walk of S is a Jordan curve that passes through the 2n endpoints of the segments in S, and contains each (open) segment of S either completely on its boundary, or completely in its interior, or completely in its exterior. A J-walk that is a polygon with exactly 2n vertices is called a P-walk of S. (See the figure below.) If a J-walk contains all segments of S on its boundary, then it is called a J-traversal. A P-walk whose (open) exterior is void of any segment of S is called a circumscribing P-walk. (a) Show that S has a J-traversal. [Hint: use induction.] (b) Show that S has a J-traversal that is a polygon with O(n) vertices? [Hint: Extend each segment of S (in some arbitrary order) from both sides until it hits (the extension of) another segment. Now the plane is divided into O(n) convex regions. Navigate through these regions.] (c) Show that S has a P-walk. [Harder. Use the above hint.] (d) Devise an efficient algorithm to construct a P-walk of S. (e) Show that the instance below-left has no circumscribing P-walk.

END