Elements of 2d Computational Geometry. AI for Gaming Santa Clara, 2016

Similar documents
Geometry - Chapter 1 - Corrective #1

Elementary Planar Geometry

pine cone Ratio = 13:8 or 8:5


Chapter 2: Transformations. Chapter 2 Transformations Page 1

Unit 5: Transformations in the Coordinate Plane

Topics in geometry Exam 1 Solutions 7/8/4

Unit 12 Topics in Analytic Geometry - Classwork

Rational Numbers: Graphing: The Coordinate Plane

8.1 Geometric Queries for Ray Tracing

Jim Lambers MAT 169 Fall Semester Lecture 33 Notes

Geometry Reasons for Proofs Chapter 1

Analytic Geometry. Pick up the weekly agenda sheet and the packet for the week. Find your vocabulary match. This is your new team member.

Multivariable Calculus

Geometry 1-1. Non-collinear Points not on the same line. Need at least 3 points to be non-collinear since two points are always collinear

Moore Catholic High School Math Department

11.1 Rigid Motions. Symmetry

Section 12.1 Translations and Rotations

Lesson 5: Definition of Rotation and Basic Properties

Mathematics For Class IX Lines and Angles

Term Definition Figure

Geometry ~ Chapter 1 Capacity Matrix

Geometry Rules. Triangles:

S56 (5.3) Higher Straight Line.notebook June 22, 2015

UNIT 1: TRANSFORMATIONS IN THE COORDINATE PLANE

Geometry: Unit 1: Transformations. Chapter 14 (In Textbook)

Unit 7. Transformations

1 Affine and Projective Coordinate Notation

5.3 Angles and Their Measure

Trigonometry Review Day 1

a triangle with all acute angles acute triangle angles that share a common side and vertex adjacent angles alternate exterior angles

CCGPS UNIT 5 Semester 2 COORDINATE ALGEBRA Page 1 of 38. Transformations in the Coordinate Plane

Unit 6: Connecting Algebra and Geometry Through Coordinates

Chapter 10 Similarity

Segment Addition Postulate: If B is BETWEEN A and C, then AB + BC = AC. If AB + BC = AC, then B is BETWEEN A and C.

MAC Module 1 Trigonometric Functions. Rev.S08

Geometry Pre AP Graphing Linear Equations

I can identify, name, and draw points, lines, segments, rays, and planes. I can apply basic facts about points, lines, and planes.

MAKE GEOMETRIC CONSTRUCTIONS

1-1. Points, Lines, and Planes. Lesson 1-1. What You ll Learn. Active Vocabulary

You ll use the six trigonometric functions of an angle to do this. In some cases, you will be able to use properties of the = 46

Euclid s Axioms. 1 There is exactly one line that contains any two points.

Lesson 2: Basic Concepts of Geometry

GEOMETRY POSTULATES AND THEOREMS. Postulate 1: Through any two points, there is exactly one line.

Downloaded from

(1) Page #1 24 all. (2) Page #7-21 odd, all. (3) Page #8 20 Even, Page 35 # (4) Page #1 8 all #13 23 odd

Geometry. Topic 1 Transformations and Congruence

Math 7 Glossary Terms

Point A location in geometry. A point has no dimensions without any length, width, or depth. This is represented by a dot and is usually labelled.

Geometry Basics of Geometry Precise Definitions Unit CO.1 OBJECTIVE #: G.CO.1

Moore Catholic High School Math Department

Geometry: Semester 1 Midterm

Definitions. You can represent a point by a dot and name it by a capital letter.

Term: description named by notation (symbols) sketch an example. The intersection of two lines is a. Any determine a line.

Geometry Lesson 1-1: Identify Points, Lines, and Planes Name Hr Pg. 5 (1, 3-22, 25, 26)


Test Review: Geometry I TEST DATE: ALL CLASSES TUESDAY OCTOBER 6

1 Trigonometry. Copyright Cengage Learning. All rights reserved.

Videos, Constructions, Definitions, Postulates, Theorems, and Properties

AQA GCSE Further Maths Topic Areas

.(3, 2) Co-ordinate Geometry Co-ordinates. Every point has two co-ordinates. Plot the following points on the plane. A (4, 1) D (2, 5) G (6, 3)

Introduction to Geometry

with slopes m 1 and m 2 ), if and only if its coordinates satisfy the equation y y 0 = 0 and Ax + By + C 2

Lines That Intersect Circles

a) Draw a line through points A and B. What is one symbol or name for it?

Geometry (H) Worksheet: 1st Semester Review:True/False, Always/Sometimes/Never

NAME DATE PER. GEOMETRY FALL SEMESTER REVIEW FIRST SIX WEEKS PART 1. A REVIEW OF ALGEBRA Find the correct answer for each of the following.

Chapter 1-2 Points, Lines, and Planes

MATHEMATICS 105 Plane Trigonometry

ME 111: Engineering Drawing. Geometric Constructions

Chapter 1 Tools of Geometry

Geometry Vocabulary. acute angle-an angle measuring less than 90 degrees

Chapter 8. Properties of Triangles and Quadrilaterals. 02/2017 LSowatsky

Angles. Classification Acute Right Obtuse. Complementary s 2 s whose sum is 90 Supplementary s 2 s whose sum is 180. Angle Addition Postulate

Transformations and Isometries

Chapter 1. Essentials of Geometry

GEOMETRY is the study of points in space

Chapter 6.1 Medians. Geometry

Answers to practice questions for Midterm 1

Section 1-1 Points, Lines, and Planes

Introduction to Transformations. In Geometry

M2 GEOMETRY REVIEW FOR MIDTERM EXAM

Grade IX. Mathematics Geometry Notes. #GrowWithGreen

Type of Triangle Definition Drawing. Name the triangles below, and list the # of congruent sides and angles:

Chapter 11. Parametric Equations And Polar Coordinates

Geometry Semester 1 Final Exam Study Guide FCS, Mr. Garcia

Term Definition Figure

Geometry. Oklahoma Math Day INSTRUCTIONS:

2 Geometry Solutions


If three points A (h, 0), P (a, b) and B (0, k) lie on a line, show that: a b 1.

Objectives: (What You ll Learn) Identify and model points, lines, planes Identify collinear and coplanar points, intersecting lines and planes

no triangle can have more than one right angle or obtuse angle.

Answers. (1) Parallelogram. Remember: A four-sided flat shape where the opposite sides are parallel is called a parallelogram. Here, AB DC and BC AD.

A rotation is a transformation that turns a figure around a point, called the.

Review Exercise. 1. Determine vector and parametric equations of the plane that contains the

Chapter 8.1: Circular Functions (Trigonometry)

Postulates, Theorems, and Corollaries. Chapter 1

Math 3315: Geometry Vocabulary Review Human Dictionary: WORD BANK

Unit 1, Lesson 1: Moving in the Plane

Transcription:

Elements of 2d Computational Geometry AI for Gaming Santa Clara, 2016

3d Determinants Absolute value is the volume of the parallelepiped Sign is the orientation

2d Orientation A+B+C A+C B+C C A+B A B Sign of determinant a x a y 1 b x b y 1 c x c y 1 depends on the orientation of the points (a x,a y, 1), (b x,b y, 1) and (c x,c y, 1). If (a x,a y ), (b x,b y ), and (c x,c y ) are oriented counterclockwise, then and only then is the determinant positive.

Application Do two lines intersect? C B A D C lies on a di erent side of AB than D Signs of determinants are di erent a x a y 1 b x b y 1 c x c y 1 a x a y 1 b x b y 1 d x d y 1 < 0.

2d Circles Three points determine a circle If they are collinear, the circle is degenerate with a radius of infinity A B C

2d Circles Geometric construction: Draw two chords AB and BC A B C

2d Circles Given three points A, B, C Draw cords AB, BC A B Create perpendicular bisectors for each chord By drawing a large enough circle around A and B The intersection is the center of the circle Radius is the distance of center point to one of the three points C

2d Circles Determine whether a point is inside a circle If the circle is given by center and radius Calculate distance of point from center and compare with radius If the circle is given by three points Use determinant formula No need to calculate circle first

2d Circles Calculate the following determinant a x a y a 2 x + a 2 y 1 b x b y b 2 x + b 2 y 1 c x c y c 2 x + c 2 y 1 d x d y d 2 x + d 2 y 1 = a x d x a y d y (a x d x ) 2 +(a y d y ) 2 b x d x b y d y (b x d x ) 2 +(b y d y ) 2 c x d x c y d y (c x d x ) 2 +(c y d y ) 2 If A, B, C are in counter-clockwise order and the determinant is positive, then D lies inside the circle If A, B, C are in counter-clockwise order and the determinant is negative, then D lies not inside the circle If A, B, C are not in counter-clockwise order and the determinant is negative, then D lies inside the circle If A, B, C are not in counter-clockwise order and the determinant is positive, then D lies not inside the circle

Barycentric Coordinates Given three (not collinear) points a, b, c Every point p can be written as p=αa+βb+(1-α-β)c Divides plane into seven areas depending on the signs of the coefficients -+- +-- Α ++- Β +++ P -++ +-+ C --+

~p = ~a + ~ b +(1 )~c, ~p ~c = (~a ~c)+ ( ~ b ~c) which implies (~p ~c) (~a ~c) = (~a ~c) (~a ~c)+ ( ~ b ~c) (~a ~c) (~p ~c) ( ~ b ~c) = (~a ~c) ( ~ b ~c)+ ( ~ b ~c) ( ~ b ~c) which gives according to Cramer s rule = = (~p ~c) (~a ~c) ( ~ b ~c) (~a ~c) (~p ~c) ( ~ b ~c) ( ~ b ~c) ( ~ b ~c) (~a ~c) (~a ~c) ( ~ b ~c) (~a ~c) (~a ~c) ( ~ b ~c) ( ~ b ~c) ( ~ b ~c) (~a ~c) (~a ~c) (~p ~c) (~a ~c) (~a ~c) ( ~ b ~c) (~p ~c) ( ~ b ~c) (~a ~c) (~a ~c) ( ~ b ~c) (~a ~c) (~a ~c) ( ~ b ~c) ( ~ b ~c) ( ~ b ~c)

Barycentric Coordinates We note that in the preceding formula Only two dot products change if we change point p

Lines, Rays, Segments Lines Given by two points a and d d L={(1-t)a+td t real} a

Lines, Rays, Segments Ray given by two points d L={(1-t)a+td t >= 0} a

Lines, Rays, Segments Segment between two points d a L={(1-t)a+td 0 <= t <= 1}

Dot Product v obtuse right angle acute u * v<0 u * v=0 u * v>0 u The dot product can be used for many geometric tests

Dot Product v ~u ~v = ~u ~v cos ~u ~u = ~u 2 v ~u ~v = ~v ~u ~u (~v + ~w) = ~u ~v + ~u ~w (r~u) (s~v) = sr(~u ~v) θ d u d=(u v)(u u) -1 u d = u -1 u v= v cos θ

Bounding Volumes Sphere Axis Aligned Bounding Box (AABB) Oriented bounding box (OBB) better bound, better culling faster test, less memory

AABB Representations min max min widths center radius

AABB Intersections Project min and max points on x-axis and y-axis AABB intersects if the projected intervals intersect

AABB Intersections Intersection test for min-max representation class AABB: def init (self, mini, maxi): self.mini = mini self.maxi = maxi def str (self): return [{},{}].format(str(self.mini), str(self.maxi) def intersect(self, other): if self.maxx < other.minx or self.minx > self.maxx: return False if self.maxy < other.miny or self.miny > self.maxy: return False return True

Intersection Ray Circle Ray given by origin and direction Solve for the points that lie on the outside of the circle {P+td t>0} r C Check whether they lie on the ray d ~p + t ~ d ~c = r (~p + t ~ d ~c) (~p + t ~ d ~c) = r 2 (~m + t ~ d) (~m + t ~ d) = r 2 with ~m = ~p ~c ( ~ d ~d)t 2 + 2(~m ~d)t +(~m ~m r 2 ) = 0 t = (~m ~d) ± q (~m ~d) 2 ~m ~m + r 2 P

Intersection Ray Circle Intersect twice Intersect tangentially No intersection False Intersection Ray starts inside

Intersection Ray AABB Use intersection with horizontal and vertical slab. If there is no or only one intersection, then the ray cannot intersect the AABB. Horizontal Slab If the intersections do not overlap, then the ray does not intersect the AABB. Vertical Slab