Basic tool: orientation tests

Similar documents
Computational Geometry. Free Lab Exercises. Year Q1

Reconstructing Orthogonal Polyhedra from Putative Vertex Sets

Lifting Transform, Voronoi, Delaunay, Convex Hulls

Voronoi Diagrams and Delaunay Triangulations. O Rourke, Chapter 5

Chapter 8. Voronoi Diagrams. 8.1 Post Oce Problem

Computational Geometry

Voronoi diagrams Delaunay Triangulations. Pierre Alliez Inria

Restricted-Orientation Convexity in Higher-Dimensional Spaces

UNIVERSITI TEKNOLOGI MALAYSIA SSE 1893 ENGINEERING MATHEMATICS TUTORIAL 5

Computational Geometry

1/25 Warm Up Find the value of the indicated measure

Lectures 19: The Gauss-Bonnet Theorem I. Table of contents

3. Voronoi Diagrams. 3.1 Definitions & Basic Properties. Examples :

CS4733 Class Notes. 1 2-D Robot Motion Planning Algorithm Using Grown Obstacles

Minimum-Area Rectangle Containing a Set of Points

We have set up our axioms to deal with the geometry of space but have not yet developed these ideas much. Let s redress that imbalance.

EXTREME POINTS AND AFFINE EQUIVALENCE

Straight Line motion with rigid sets

Elementary Planar Geometry

Packing Two Disks into a Polygonal Environment

Orthogonal Ham-Sandwich Theorem in R 3

Lesson 7.1. Angles of Polygons

1/60. Geometric Algorithms. Lecture 1: Introduction. Convex Hulls

MISCELLANEOUS SHAPES

Gardener s spline curve

Outline of the presentation

COMP331/557. Chapter 2: The Geometry of Linear Programming. (Bertsimas & Tsitsiklis, Chapter 2)

Polygons and Convexity

Preferred directions for resolving the non-uniqueness of Delaunay triangulations

ACT Math and Science - Problem Drill 11: Plane Geometry

Intersecting Simple Surfaces. Dr. Scott Schaefer

Computing a visibility polygon using few variables

The conjecture is unresolved even for the case d = (d - 1) + 1. When dt =

Computational Geometry Algorithmische Geometrie

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality

January Regional Geometry Team: Question #1. January Regional Geometry Team: Question #2

4. Conclusion. 5. Acknowledgment. 6. References

Algorithms for the Construction of Digital Convex Fuzzy Hulls

A Point in Non-Convex Polygon Location Problem Using the Polar Space Subdivision in E 2

Pebble Sets in Convex Polygons

Crossing Families. Abstract

VORONOI DIAGRAM PETR FELKEL. FEL CTU PRAGUE Based on [Berg] and [Mount]

Linear Programming in Small Dimensions

Advanced Algorithms Computational Geometry Prof. Karen Daniels. Fall, 2012

6.854J / J Advanced Algorithms Fall 2008

Motion Planning. O Rourke, Chapter 8

2D Geometry. Pierre Alliez Inria Sophia Antipolis

Pick s Theorem and Lattice Point Geometry

Notes on Spherical Geometry

Geometric Transformations: Translation:

pine cone Ratio = 13:8 or 8:5

A technique for adding range restrictions to. August 30, Abstract. In a generalized searching problem, a set S of n colored geometric objects

Practical Linear Algebra: A Geometry Toolbox

Computational Geometry. Geometry Cross Product Convex Hull Problem Sweep Line Algorithm

Answer Key: Three-Dimensional Cross Sections

Lines That Intersect Circles

Differential Geometry: Circle Patterns (Part 1) [Discrete Conformal Mappinngs via Circle Patterns. Kharevych, Springborn and Schröder]

Dirichlet Voronoi Diagrams and Delaunay Triangulations

Other Voronoi/Delaunay Structures

Computational Geometry

Generalized kernels of polygons under rotation

The Geometry of Carpentry and Joinery

CS 532: 3D Computer Vision 14 th Set of Notes

Planar graphs. Chapter 8

Stabbers of line segments in the plane

2-1 Transformations and Rigid Motions. ENGAGE 1 ~ Introducing Transformations REFLECT

Geometry Unit 6 Properties of Quadrilaterals Classifying Polygons Review

Generating Tool Paths for Free-Form Pocket Machining Using z-buffer-based Voronoi Diagrams

High School Geometry. Correlation of the ALEKS course High School Geometry to the ACT College Readiness Standards for Mathematics

6.7 Regular Polygons

Geometry/Trigonometry Unit 5: Polygon Notes Period:

Lagrange multipliers October 2013

Glossary of dictionary terms in the AP geometry units

Voronoi diagram and Delaunay triangulation

Voronoi Diagrams in the Plane. Chapter 5 of O Rourke text Chapter 7 and 9 of course text

ON THE STRETCH FACTOR OF CONVEX POLYHEDRA WHOSE VERTICES ARE (ALMOST) ON A SPHERE

Geometry Reasons for Proofs Chapter 1

7. The Gauss-Bonnet theorem

Geometry Definitions and Theorems. Chapter 9. Definitions and Important Terms & Facts

In what follows, we will focus on Voronoi diagrams in Euclidean space. Later, we will generalize to other distance spaces.

The equal tangents property

Lagrange multipliers 14.8

FACES OF CONVEX SETS

CHAPTER 2 REVIEW COORDINATE GEOMETRY MATH Warm-Up: See Solved Homework questions. 2.2 Cartesian coordinate system

Geometric Streaming Algorithms with a Sorting Primitive (TR CS )

Geometric Algorithms in Three Dimensions Tutorial. FSP Seminar, Strobl,

(Master Course) Mohammad Farshi Department of Computer Science, Yazd University. Yazd Univ. Computational Geometry.

heptagon; not regular; hexagon; not regular; quadrilateral; convex concave regular; convex

Angles of Polygons. Essential Question What is the sum of the measures of the interior angles of a polygon?

Computational Geometry [csci 3250]

GENERALIZED HALFSPACES IN RESTRICTED-ORIENTATION CONVEXITY

Partitioning Orthogonal Polygons by Extension of All Edges Incident to Reflex Vertices: lower and upper bounds on the number of pieces

Math 5593 Linear Programming Lecture Notes

Suggested List of Mathematical Language. Geometry

International Journal of Computational Geometry & Applications c World Scientific Publishing Company

Voronoi Diagrams. A Voronoi diagram records everything one would ever want to know about proximity to a set of points

Lesson Plan #39. 2) Students will be able to find the sum of the measures of the exterior angles of a triangle.

Geometric Algorithms. 1. Objects

274 Curves on Surfaces, Lecture 5

Math 208/310 HWK 4 Solutions Section 1.6

Transcription:

Basic tool: orientation tests Vera Sacristán Computational Geometry Facultat d Informàtica de Barcelona Universitat Politècnica de Catalunya

Orientation test in R 2 Given 3 points p,, r in the plane, efficiently and robustely decide whether r lies to the left, to the right or on the oriented line p. r 1 r 3 p r 2

Orientation test in R 2 Given 3 points p,, r in the plane, efficiently and robustely decide whether r lies to the left, to the right or on the oriented line p. r 1 Consider the vectors p... p r 2 r 3

Orientation test in R 2 Given 3 points p,, r in the plane, efficiently and robustely decide whether r lies to the left, to the right or on the oriented line p. r 1 Consider the vectors p and pr. p r 2 r 3

Orientation test in R 2 Given 3 points p,, r in the plane, efficiently and robustely decide whether r lies to the left, to the right or on the oriented line p. r 1 Consider the vectors p and pr. p Point r lies on the line p x p x r x p x y p y r y p y = 0 Point r lies to the left of the oriented line p x p x y p y Point r lies to the right of the oriented line p x p x y p y r x p x r y p y r x p x r y p y > 0 r 3 r 2 < 0

Orientation test in R 2 Given 3 points p,, r in the plane, efficiently and robustely decide whether r lies to the left, to the right or on the oriented line p. Consider the vectors p and pr. p Point r lies on the line p x p x r x p x y p y r y p y = 0 Point r lies to the left of the oriented line p x p x r x p x y p y r y p y > 0 Point r lies to the right of the oriented line p x p x r x p x y p y r y p y < 0 Notation det(p,, r) = x p x r x p x y p y r y p y = p x x r x p y y r y 1 1 1 r 1 r 2 r 3

Relative position point - line l: a line (through points p and ) r: a point Output: Relative position of r w.r.t. l. p r l

Relative position point - line l: a line (through points p and ) r: a point Output: Relative position of r w.r.t. l. p r l Intersection test line segment - line l: a line (through points p and ) s: a line segment (with endpoints a and b) Output: a Yes/No they intersect b p a b b l a

Intersection test line segment - halfline l: halfline (from p through ) s: a line segment (with endpoints a and b) Output: Yes/No they intersect b p a b a b l a

Intersection test line segment - halfline l: halfline (from p through ) s: a line segment (with endpoints a and b) Output: Yes/No they intersect b p a b a b l a Intersection test line segment - line segment s 1 : a line segment (with endpoints p and ) s 2 : a line segment (with endpoints a and b) Output: Yes/No they intersect p a b a a b b

Intersection test line - polygon l: a line (through p and ) P : a polygon (with vertices p 1, p 2,..., p m ) Yes/No they intersect. If they do, the edges of P intersecting l

Intersection test line - polygon l: a line (through p and ) P : a polygon (with vertices p 1, p 2,..., p m ) Yes/No they intersect. If they do, the edges of P intersecting l What if the polygon is convex?

Turn orientation A polygonal line p 1, p 2,..., p n Output: Left/right classification of its turns p 1

Turn orientation A polygonal line p 1, p 2,..., p n Output: Left/right classification of its turns p 1 Point in triangle test A triangle T with vertices p 1, p 2, p 3 A uery point Output: Relative position of w.r.t. T T

Point in polygon test A polygon p 1, p 2,..., p n A uery point Output: Yes/No P

Point in polygon test A polygon p 1, p 2,..., p n A uery point Output: Yes/No P What if the polygon is convex?

Supporting lines point - polygon A polygon P with vertices p 1, p 2,..., p n A point not belonging to the convex hull of P Output: Lines through and P that leave all of P to one side P

Supporting lines point - polygon A polygon P with vertices p 1, p 2,..., p n A point not belonging to the convex hull of P Output: Lines through and P that leave all of P to one side P

Supporting lines point - polygon A polygon P with vertices p 1, p 2,..., p n A point not belonging to the convex hull of P Output: Lines through and P that leave all of P to one side What if the polygon is convex? P

What happens in R 3?

Oriented area of a triangle p r Oriented area (p,, r) = 1 2 p x x r x p y y r y 1 1 1 Discrete and Algorithmic Geometry, Facultat de Matemàtiues i Estadística, UPC

Oriented area of a triangle p r Oriented area (p,, r) = 1 2 p x x r x p y y r y 1 1 1 Oriented volume of a tetrahedron a d c b Oriented volume (a, b, c, d) = 1 6 a x b x c x d x a y b y c y d y a z b z c z d z 1 1 1 1 Discrete and Algorithmic Geometry, Facultat de Matemàtiues i Estadística, UPC

Relative position point-plane If a, b, and c are not aligned, they define a plane π. c π a b Discrete and Algorithmic Geometry, Facultat de Matemàtiues i Estadística, UPC

Relative position point-plane If a, b, and c are not aligned, they define a plane π. π a b c Point x lies in the halfspace π + det(x, a, b, c) > 0. Point x lies in the plane π det(x, a, b, c) = 0. Point x lies in the halfspace π det(x, a, b, c) < 0. Discrete and Algorithmic Geometry, Facultat de Matemàtiues i Estadística, UPC

2D application: Relative position point-circle Proposition 1 The intersection of the paraboloid whose euation is z = x 2 + y 2 with a non vertical plane is a curve that projects orthogonally onto a circle in the plane z = 0. Discrete and Algorithmic Geometry, Facultat de Matemàtiues i Estadística, UPC

2D application: Relative position point-circle Proposition 1 The intersection of the paraboloid whose euation is z = x 2 + y 2 with a non vertical plane is a curve that projects orthogonally onto a circle in the plane z = 0. Proof: } } } z = x 2 + y 2 x 2 + y 2 = 2ax + 2by + c (x a) 2 + (y b) 2 = c + a 2 + b 2 z = 2ax + 2by + c z = 0 z = 0 If c < a 2 b 2, the intersection is empty. If c = a 2 b 2, the intersection is the point (a, b, a 2 + b 2 ). If c > a 2 b 2, the intersection is a curve (in fact, an ellipse) that projects onto the circle of the plane z = 0 whose center is (a, b) and whose radius is r = c + a 2 + b 2. Discrete and Algorithmic Geometry, Facultat de Matemàtiues i Estadística, UPC

2D application: Relative position point-circle Proposition 2 Let x, a, b, c be four points in the plane z = 0, and let x, a, b, c respectively be their vertical projections onto the paraboloid z = x 2 + y 2. If a, b, c are not aligned, let C be the circle through a, b, c, and let π be the plane through a, b, c. Then: The point x lies in the circle C if and only if x lies in the plane π. The point x lies in the interior of the circle C if and only if x lies in the lower half-space determined by π. The point x lies in the exterior of the circle C if and only if x lies in the upper half-space determined by π. Discrete and Algorithmic Geometry, Facultat de Matemàtiues i Estadística, UPC

2D application: Relative position point-circle Proposition 2 Let x, a, b, c be four points in the plane z = 0, and let x, a, b, c respectively be their vertical projections onto the paraboloid z = x 2 + y 2. If a, b, c are not aligned, let C be the circle through a, b, c, and let π be the plane through a, b, c. Then: The point x lies in the circle C if and only if x lies in the plane π. The point x lies in the interior of the circle C if and only if x lies in the lower half-space determined by π. The point x lies in the exterior of the circle C if and only if x lies in the upper half-space determined by π. Proof: Due to Proposition 1 and the convexity of the paraboloid. Discrete and Algorithmic Geometry, Facultat de Matemàtiues i Estadística, UPC

2D application: Relative position point-circle Corollary Let a, b and c be three non aligned points in the plane, that appear angularly sorted in counterclockwise order in the circle C that they determine. Let x be any point in the plane. Then: The point x lies in the circle C if and only if det(x, a, b, c ) = 0. The point x lies in the interior of C if and only if det(x, a, b, c ) < 0. The point x lies in the exterior of C if and only if det(x, a, b, c ) > 0. Discrete and Algorithmic Geometry, Facultat de Matemàtiues i Estadística, UPC

2D application: Relative position point-circle Observation In order to compute the determinant of the previous corollary, it is convenient to do the calculations in terms of the differences between the values of the coordinates of the points involved, and to avoid making calculations (specially, products) in terms of the coordinate values, if possible: x 1 x 2 x 2 1 + x 2 2 1 a 1 a 2 a 2 1 + a 2 2 1 b 1 b 2 b 2 1 + b 2 2 1 c 1 c 2 c 2 1 + c 2 2 1 = b 1 a 1 b 2 a 2 (b 1 a 1 )(b 1 + a 1 ) + (b 2 a 2 )(b 2 + a 2 ) c 1 a 1 c 2 a 2 (c 1 a 1 )(c 1 + a 1 ) + (c 2 a 2 )(c 2 + a 2 ) x 1 a 1 x 2 a 2 (x 1 a 1 )(x 1 + a 1 ) + (x 2 a 2 )(x 2 + a 2 ) Discrete and Algorithmic Geometry, Facultat de Matemàtiues i Estadística, UPC

A BASIC TOOL: ORIENTATION TESTS FURTHER READING J. O Rourke Computational Geometry in C Cambridge University Press, 1994 (2nd ed. 1998), pp. 17-35. F. P. Preparata and M. I. Shamos Computational Geometry: An Introduction Springer-Verlag, 1985, pp. 36-45.