Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computational Geometry 2012/10/23. Computational Geometry A branch of computer science that studies algorithms for solving geometric problems Applications:

Similar presentations


Presentation on theme: "Computational Geometry 2012/10/23. Computational Geometry A branch of computer science that studies algorithms for solving geometric problems Applications:"— Presentation transcript:

1 Computational Geometry 2012/10/23

2 Computational Geometry A branch of computer science that studies algorithms for solving geometric problems Applications: computer graphics, robotics, VLSI design, computer aided design, and statistics.

3 Intersection Point of Two Lines The equations of the lines are P a = P1 + u a ( P2 - P1 ) //P1: starting point; (P2-P1):vector along line a P b = P3 + u b ( P4 - P3 ) //P3: starting point; (P4-P3):vector along line b P a : A point on line a P b : A point on line b

4 Intersection Point of Two Lines Solving for the point where P a = P b gives the following two equations in two unknowns (u a and u b )  x1 + u a (x2 - x1) = x3 + u b (x4 - x3)  y1 + u a (y2 - y1) = y3 + u b (y4 - y3)

5 Solving u a and u b

6 Intersection Point of Two Lines Substituting either u a or u b into the corresponding equation for the line gives the intersection point.  x = x1 + u a (x2 - x1)  y = y1 + u a (y2 - y1)

7 Intersection Point of Two Lines The denominators for the equations for u a and u b are the same. If the denominator for the equations for u a and u b is 0 then the two lines are parallel. If the denominator and numerator for the equations for u a and u b are 0 then the two lines are coincident.

8 Intersection Point of Two Lines The equations apply to lines, if the intersection of line segments is required then it is only necessary to test if u a and u b lie between 0 and 1. Whichever one lies within that range then the corresponding line segment contains the intersection point. If both lie within the range of 0 to 1 then the intersection point is within both line segments.

9 Cross Product The cross product p 1 × p 2 can be interpreted as the signed area of the parallelogram formed by the points (0, 0), p 1, p 2, and p 1 + p 2 = (x 1 + x 2, y 1 + y 2 ).

10 Cross Product The cross product p 1 × p 2 can be interpreted as the signed area of the parallelogram formed by the points (0, 0), p 1, p 2, and p 1 + p 2 = (x 1 + x 2, y 1 + y 2 ). An equivalent definition gives the cross product as the determinant of a matrix:

11 Cross Product Actually, the cross product is a three- dimensional concept. It is a vector that is perpendicular to both p 1 and p 2 according to the “right-hand rule” and whose magnitude is |x 1 y 2 – x 2 y 1 |. Below, we will just treat the cross product simply as the value of x 1 y 2 – x 2 y 1.

12

13

14

15 Q&A


Download ppt "Computational Geometry 2012/10/23. Computational Geometry A branch of computer science that studies algorithms for solving geometric problems Applications:"

Similar presentations


Ads by Google