Computational Geometry Convex Hulls Robust Geometric Primitives Degeneracy and Stability Nick Pilkington.

Slides:



Advertisements
Similar presentations
Geometry Introduction
Advertisements

Computer Graphics- SCC 342
Computational Geometry
Computational Geometry
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
ADA: 15. Basic Math1 Objective o a reminder about dot product and cross product, and their use for analyzing line segments (e.g. do two segments.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Convex Hull obstacle start end Convex Hull Convex Hull
C o m p u t i n g C O N V E X H U L L S by Kok Lim Low 10 Nov 1998 COMP Presentation.
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
Ruslana Mys Delaunay Triangulation Delaunay Triangulation (DT)  Introduction  Delaunay-Voronoi based method  Algorithms to compute the convex hull 
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
1 Convex Hull in Two Dimensions Jyun-Ming Chen Refs: deBerg et al. (Chap. 1) O’Rourke (Chap. 3)
Computational Geometry
Computational Geometry for the Tablet PC
1 Today’s Material Computational Geometry Problems –Closest Pair Problem –Convex Hull Jarvis’s March, Graham’s scan –Farthest Point Problem.
Algorithms and Data Structures Lecture 13. Agenda: Plane Geometry: algorithms on polygons - Verification if point belongs to a polygon - Convex hull.
5/17/2015 1:32 AMConvex Hull1 obstacle start end.
What does that mean? To get the taste we will just look only at some sample problems... [Adapted from S.Suri]
Query Processing in Databases Dr. M. Gavrilova.  Introduction  I/O algorithms for large databases  Complex geometric operations in graphical querying.
Convex Hulls Computational Geometry, WS 2006/07 Lecture 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.
Lection 1: Introduction Computational Geometry Prof.Dr.Th.Ottmann 1 History: Proof-based, algorithmic, axiomatic geometry, computational geometry today.
2.5Formulas and Additional Applications from Geometry
Computational Geometry
Geometric Algorithms1 segment intersection orientation point inclusion simple closed path.
Chapter 2 Section 5 Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Computational Geometry HKU ACM ICPC Training 2010.
Advanced Algorithm Design and Analysis (Lecture 9) SW5 fall 2004 Simonas Šaltenis E1-215b
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
1. Show geometrically that given any two points in the hyperbolic plane there is always a unique line passing through them. § 23.1 Given point A(x1, y1)
Convex Hull. What is the Convex Hull? Imagine a set of points on a board with a nail hammered into each point. Now stretch a rubber band over all the.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
C o m p u t i n g C O N V E X H U L L S. Presentation Outline 2D Convex Hulls –Definitions and Properties –Approaches: Brute Force Gift Wrapping QuickHull.
1 Triangulation Supplemental From O’Rourke (Chs. 1&2) Fall 2005.
Chapter 2 Section 5. Objectives 1 Copyright © 2012, 2008, 2004 Pearson Education, Inc. Formulas and Additional Applications from Geometry Solve a formula.
1 11. Polygons Polygons 2D polygons ( 다각형 ) –Polygon sides are all straight lines lying in the same plane 3D polyhedra ( 다면체 )  chap. 12 –Polyhedra.
Using a Protractor Geometry Lesson. 3 A 180 o Protractor Outside scale from 0 o to 180 o going in a clockwise direction. Inside scale from 0 o to 180.
Computational Geometry 2D Convex Hulls
A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R. Otherwise, it is called concave.
COMPUTATIONAL GEOMETRY AND MATRIX MULTIPLICATION Mohammed Zeeshan Farooqui Minhaj Uddin.
Convex Hull 2012/10/23. Convex vs. Concave A polygon P is convex if for every pair of points x and y in P, the line xy is also in P; otherwise, it is.
CS6234 Advanced Algorithms - Convex hull. Terminologies – ◦ Convex hull of a set Q of points is the smallest convex polygon P for which each point in.
GEOMETRY JEOPARDY PolygonsArea & Perimeter Symmetry & Transformations Lines & Angles Triangles & Congruency
Convex hulls in 3D Maciej Kot. Finding convex hull Given a set of points, find a convex hull that contains all of them and is minimal.
Computer Graphics Lecture 08 Taqdees A. Siddiqi Computer Graphics Filled Area Primitives I Lecture 08 Taqdees A. Siddiqi
Data Structure & Algorithm 13 – Computational Geometry JJCAO.
Line Sweep Algorithms Schalk-Willem Krüger – 2009 Training Camp 1 presentation.start();
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
Introduction to Polygons
Computer Graphics Filled Area Primitives II Lecture 09 Taqdees A
Convex Hull.
Concepts, algorithms for clipping
Query Processing in Databases Dr. M. Gavrilova
Grids Geometry Computational Geometry
Convex Hull obstacle start end 11/21/2018 4:05 AM Convex Hull
Grids Geometry Computational Geometry
Computational Geometry Capter:1-2.1
Geometry.
Convex Sets & Concave Sets
Computational Geometry for the Tablet PC
I. The Problem of Molding
Lecture 13 Clipping & Scan Conversion
CHAPTER 33 Computational Geometry
CMPS 3130/6130: Computational Geometry Spring 2017
Convex Hull obstacle start end 4/30/2019 5:21 PM Convex Hull
Geometry.
Computational Geometry
Presentation transcript:

Computational Geometry Convex Hulls Robust Geometric Primitives Degeneracy and Stability Nick Pilkington

Convex Hull

Identifying  Two points furthest distance from each other.  Minimum set of points enclosing…  Ideas of fencing, encompassing or enclosing  Diameter, furthest pair, longest distance between…

Algorithms  Jarvis March  O(n.h)  Graham Scan  O(n.log n)

Jarvis March  Pick a point that you know to be on the convex hull.  To determine the next point on the hull, loop through all points and find the one that forms the minimum sized anticlockwise angle off the horizontal axis from the previous point.  Continue until you encounter the first point

Pros and Cons  Pros  Easy to program  Cons  Slow! Possibly O(n 2 )

Graham Scan  Find a point you know to be on the convex hull. (Lower y coordinate)  Sort all other points angularly around this point (anti clockwise), by calculating the angle that each point makes with the x axis (within the range 0 to 360 degrees)  Add the first two points to the hull.  For every other point except the last point  Make it the next point in the convex hull  Check to see if the angle it forms with the previous two points is greater than 180 degrees  As long as the angle formed with the last two points is greater than 180 degrees, remove the previous point  To add the last point  Perform the deletion above,  Check to see if the angle the last point forms with the previous point and the first point is greater than 180 degrees or if the angle formed with the last point and the first two points is greater than 180 degrees.  If the first case is true, remove the last point, and continue checking with the next-to-last point.  If the second case is true, remove the first point and continue checking.  Stop when neither case is true.

Graham Scan

Pros and Cons  Pros  Fast  Relatively Easy to Program  Cons  Bit fiddly to program

Robust Geometric Primitives  Area of a Triangle  Line / Line Segment Intersection  Point in Polygon  Area of a Polygon  Pitfalls, Arithmetic Accuracies, Exceptions.

Area of a Triangle  Heron’s Formula  Area = Sqrt(s(s-a)(s-b)(s-c)), where s = (a+b+c)/2  Determinant / Cross Product

Line/Line Segment Above and Below Test Use the signed area of the triangle Line Segment / Line Segment Same a s above, however TWO checks are necessary!

Point in Polygon  Extend the point in a random direction forming a ray.  Find the number of times the ray intersects an edge of the polygon.  Even number of intersections = outside  Odd number of intersection = inside Algorithm generalizes to 3 dimensions!

Area of Polygon Area of polygon The area of a polygon with vertices (x 1, y 1),..., (x n, y n) is equal to the determinant: 1 | x1 x2... xn | --- | | 2 | y1 y2... yn | This formula generalizes to compute d! times the volume of a simplex in d dimensions. Areas and volumes are signed!

Area of a Polygon  Triangulation  Monte Carlo Methods

Pitfalls  Degeneracy  Ignore It !  Deal with It! Numerical Stability  Precision!  Rounding Errors!

Questions  IOI 2003 Day 2 :: Boundary Given a rectangular field with fence posts 1 meter apart along its perimeter. An number of rocks represented by polygons in the field. A viewers position. Calculate the number of fence posts that a person at the viewers position can see, unobstructed by rocks in the field. Given a rectangular field with fence posts 1 meter apart along its perimeter. An number of rocks represented by polygons in the field. A viewers position. Calculate the number of fence posts that a person at the viewers position can see, unobstructed by rocks in the field. O(N.R)72~80% O(R log R + N Log d) 100% ***Looking at the top 20 places from IOI 2003 only 6 of them scored more than 72% in this problem. ***