Download presentation

Presentation is loading. Please wait.

Published byGregory Mewes Modified over 2 years ago

1
CSE 4101/5101 Prof. Andy Mirzaian

2
Overview 2

3
3

4
Landscape of Computational Geometry Applications: Graphics Robotics Vision GIS CAD VLSI Pattern Recognition Optimization Transportation Statistics... Applications: Graphics Robotics Vision GIS CAD VLSI Pattern Recognition Optimization Transportation Statistics... Geometric Tools: Convex Hull Space subdivision Arrangements Voronoi / Delaunay Diagram Triangulations Geometric Transforms Duality... Geometric Tools: Convex Hull Space subdivision Arrangements Voronoi / Delaunay Diagram Triangulations Geometric Transforms Duality... Algorithmic Tools: general incremental divide-&-conquer space sweep topological sweep prune and search random sampling locus approach multidimensional search dynamization... 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.... 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... Analysis Tools: general amortization Davenport-Schinzel... Implementation Issues : Degeneracy (symbolic perturbation) Robustness (inexact arithmetic)... Implementation Issues : Degeneracy (symbolic perturbation) Robustness (inexact arithmetic)... 4

5
Example 1: Convex Hull 5

6
6

7
Example 2: Point set triangulation 7

8
8

9
Non-simple Simple Convex 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°. 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°. 9

10
Example 3: Simple Polygon Triangulation 10

11
Example 4: Planar Line Arrangement 11

12
Example 4: Planar Line Arrangement 12

13
Example 5: Voronoi Diagram & Delaunay Triangulation 13

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

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

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

17
Example 5: Voronoi Diagram & Delaunay Triangulation 17

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

19
D A B C D A B C Applications: Graphics Multi-window user systems … E E Example 7: Hidden Surface Removal 19

20
Koebe-Andreev-Thurston’s Circle Packing Theorem: [1]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. Koebe-Andreev-Thurston’s Circle Packing Theorem: [1]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, … Example 8: Planar Graph Drawing 20

21
Geometric Preliminaries 21

22
Metric Space (S,d) S = a set of objects called “points” of the space, d: S 2 called the distance metric Metric Axioms: ( x,y,z S) 1.d(x,y) 0 (non-negativity) 2.d(x,y) = 0 x=y (positive definiteness) 3.d(x,y) = d(y,x) (symmetry) 4.d(x,y) + d(y,z) d(x,z) (triangle inequality) S = a set of objects called “points” of the space, d: S 2 called the distance metric Metric Axioms: ( x,y,z S) 1.d(x,y) 0 (non-negativity) 2.d(x,y) = 0 x=y (positive definiteness) 3.d(x,y) = d(y,x) (symmetry) 4.d(x,y) + d(y,z) d(x,z) (triangle inequality) 22

23
d = d-dimensional real space is the set of d-vectors x=(x 1,x 2, …,x d ) d, x i (for i=1..d). d forms a vector space, i.e., it is closed under: scaling: x = ( x 1, x 2, …, x d ) d, . addition: x+y = (x 1 +y 1, x 2 +y 2, …, x d +y d ) d. d = d-dimensional real space is the set of d-vectors x=(x 1,x 2, …,x d ) d, x i (for i=1..d). d forms a vector space, i.e., it is closed under: scaling: x = ( x 1, x 2, …, x d ) d, . addition: x+y = (x 1 +y 1, x 2 +y 2, …, x d +y d ) d. x1x1 x2x2 x3x3 33 23

24
Normed space 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 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. 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 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 = x T y = x 1 y 1 + x 2 y 2 + … + x d y d defines Euclidean norm ||x|| = (|x 1 | 2 + |x 2 | 2 + … + |x d | 2 ) 1/2 24

25
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 } 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 } x -1 x O B ||x||= B 25

26
Minkowski Metric L p (1 p ) || x || p = (|x 1 | p + |x 2 | p + … + |x d | p ) 1/p d p (x,y) = || x-y || p = (|x 1 –y 1 | p + … + |x d –y d | p ) 1/p || x || p = (|x 1 | p + |x 2 | p + … + |x d | p ) 1/p d p (x,y) = || x-y || p = (|x 1 –y 1 | p + … + |x d –y d | p ) 1/p Example: L 2 : (E d : Euclidean) ||x|| 2 = (|x 1 | 2 + |x 2 | 2 + … + |x d | 2 ) 1/2 L 1 : (Manhattan) ||x|| 1 = (|x 1 | + |x 2 | + … + |x d |) L : ||x|| = max { |x 1 |, |x 2 |, …, |x d | } Example: L 2 : (E d : Euclidean) ||x|| 2 = (|x 1 | 2 + |x 2 | 2 + … + |x d | 2 ) 1/2 L 1 : (Manhattan) ||x|| 1 = (|x 1 | + |x 2 | + … + |x d |) L : ||x|| = max { |x 1 |, |x 2 |, …, |x d | } 26

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

28
points q 1, q 2, …, q k d coefficients 1, 2, …, k Linear combination: p = i i q i = 1 q q 2 + … + k q k (this is a vector sum) Affine combination: p = i i q i = 1 q q 2 + … + k q k s. t. i i =1 Convex combination: p = i i q i = 1 q q 2 + … + k q k s. t. i i =1 & i 0 points q 1, q 2, …, q k d coefficients 1, 2, …, k Linear combination: p = i i q i = 1 q q 2 + … + k q k (this is a vector sum) Affine combination: p = i i q i = 1 q q 2 + … + k q k s. t. i i =1 Convex combination: p = i i q i = 1 q q 2 + … + k q k s. t. i i =1 & i 0 Linear, affine & convex combinations 28

29
Example: d=3, k=2 x1x1 x2x2 x3x3 33 q1q1 q2q2 O Linear combinations: span(q 1,q 2 ) = { 1 q q 2 | 1, 2 } = plane(O,q 1,q 2 ) Affine combinations: aff(q 1,q 2 ) = { q 1 +(1- )q 2 | } = line q 1 q 2 Convex combinations: conv(q 1,q 2 ) = { q 1 +(1- )q 2 | 0 1 } = line segment q 1 q 2 conv(q 1,q 2,q 3 ) = triangle q 1 q 2 q 3 q1q1 q2q2 =1 0 1 =0 <0 >1 q2q2 q1q1 q3q3 r p 29

30
x y p1p1 p2p2 p3p3 > 0 (p 1 p 2 p 3 ) counter-clockwise (CCW), i.e., left turn < 0 (p 1 p 2 p 3 ) clockwise (CW), i.e., right turn = 0 (p 1 p 2 p 3 ) collinear > 0 (p 1 p 2 p 3 ) counter-clockwise (CCW), i.e., left turn < 0 (p 1 p 2 p 3 ) clockwise (CW), i.e., right turn = 0 (p 1 p 2 p 3 ) collinear ½ | | = area of triangle (p 1 p 2 p 3 ) -test: consider 3 points p i = (x i,y i ) 2, i=1,2,3 30

31
Consider d+1 points p i = (x i1,…,x id ) d, i=1..d+1. | | /d! = volume of d-simplex (p 1,p 2 …,p d+1 ). sign( ) = orientation of d-simplex (p 1,p 2 …,p d+1 ). -test in higher dimensions: 31

32
1.Polar angle comparison: (0 i < ) 1 2 (O,p 1,p 2 ) 0 [no need to compute trigonometric functions] p1p1 p2p2 O 11 22 Cont’d Some applications of -test p1p1 q1q1 p2p2 q2q2 3. Open line-segment crossing: p 1 p 2 q 1 q 2 (p 1,p 2,q 1 ) (p 1,p 2,q 2 ) < 0 and (q 1,q 2,p 1 ) (q 1,q 2,p 2 ) < 0 p r1r1 r2r2 q 2. In-sector test: q sector(p,r 1,r 2 ) q is left of r 1 and right of r 2. (assume r 2 is CCW from r 1 about p.) 32

33
(y 1 - y 2 ) x – (x 1 - x 2 ) y + x 1 y 2 - x 2 y 1 = 0 abc (x 1,y 1 ) (x 2,y 2 ) (x,y) collinear points Some special cases: non-vertical (b 0; divide by b): y = x + vertical (a 0, b=0; divide by a): x = Some special cases: non-vertical (b 0; divide by b): y = x + vertical (a 0, b=0; divide by a): x = 4. Line equation in 2D (ax+by+c=0) 33

34
Simple Polygons 34

35
Area of a simple polygon P=(p 1,p 2, …, p n ) FACT: 2 A (P) = (O, p i,p i+1 ) = (x i y i+1 – x i+1 y i ) = x i (y i+1 – y i-1 ) O pipi p i+1 P x y i=1 n nn (where O = origin, p n+1 = p 1, p 0 = p n ) Algebraic area A (P) A (P) > 0 if P is CCW, A (P) < 0 if P is CW Geometric area Area(P) = | A (P)| 35

36
A Jordan Curve is any closed non-self-crossing curve in the plane. Jordan Curve 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. 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. 36

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

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

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

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

41
Can we solve the problem in sub-linear time if P is convex? p1p1 p2p2 pnpn p n-1 Step 1: Is q in sector p 1 p n p n-1 ? If not, then return “outside” pnpn p1p1 p n-1 (O(1) time. Use -test.) Step 3: j=i+1. q is inside P qp n does not cross p i p i+1. (O(1) time.) pipi p i+1 pnpn q Step 2: Binary search. q is in sector p i p n p j, 0*
*

42
Exercises 42

43
1.Show the following relationships hold for Minkowski norms in the plane: In general, how do these Minkowski norms compare in d ? [See the CSE6118: Lecture Slide 6 for a more general result.] 2.We are given a triangle T = t 1, t 2, t 3 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.] 3.We are given a sequence P = p 1, p 2, …, p n 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. 4.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.] 43

44
5.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). 6.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.] 44

45
7.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. 45

46
END 46

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google