Download presentation
Presentation is loading. Please wait.
Published byProsper Alexander Modified over 8 years ago
1
1 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Practice Quiz next time –Geometry –Topology One quiz will not count towards your grade –The one with lowest grade –If you missed a class, you don’t need to make up
2
2 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Topology in 1D We consider subsets S of the real line, such as S=[2,3[, which includes all real numbers x: 2≤x<3 S=]2,3], which includes all real numbers x: 2<x≤3 S=[5], which contains only the number 5 S=[2,3[ + [5], which includes real numbers x: 2≤x<3 and also the number 5 The operators complement (!), boundary (.b), interior (.i), exterior (.e), closure (.k), regularization (.r) are relative to the real line Hence if S=[2,3[, then S.i=]2,3[, excluding the value 2.
3
3 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Q1 S = [2,3[ + ]3,4[ + [5], What is S.i (interior)?
4
4 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 R1 S = [2,3[ + ]3,4[ + [5], S.i = ]2,3[ + ]3,4[
5
5 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Q2 S = [2,3[ + ]3,4[ + [5], What is S.b (boundary)?
6
6 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 R2 S = [2,3[ + ]3,4[ + [5], S.b = [2] + [3] + [4] + [5]
7
7 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Q3 S = [2,3[ + ]3,4[ + [5], What is S.k (closure)?
8
8 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 R3 S = [2,3[ + ]3,4[ + [5], S.k = [2,4] + [5]
9
9 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Q4 S = [2,3[ + ]3,4[ + [5], What is S.r (regularization)?
10
10 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 R4 S = [2,3[ + ]3,4[ + [5], S.r = S.i.k = [2,4]
11
11 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Q5 You are given 2 regularized sets, A and B, in the plane. Use.i,.b,.k,.e…, and Boolean operators to express the condition that A and B touch, even though they do not interfere.
12
12 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 R5 You are given 2 regularized sets, A and B, in the plane. A and B touch, when A.i B.i= AND A.b B.b≠
13
13 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Q6 Let vector V have coordinates What are the coordinates of R(V)?
14
14 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 R6 Let vector V have coordinates R(V) = V R(V) Assuming Y goes down
15
15 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Write the geometric formulation of a test for establishing whether point C lies to the right of edge from A to B boolean right(A,B,C) { return … } Q7 AB C
16
16 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Write the geometric formulation of a test for establishing whether point C lies to the right of edge from A to B boolean right(A,B,C) { return R(AB) AC>0;} R7 A R(AB) B C AC
17
17 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Q8 Using right(A,B,C), formulate a test to establish whether point P lines inside triangle(A,B,C) boolean PinT(A,B,C,P) {return … ;} A B C P
18
18 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 R8 Using right(A,B,C), formulate a test to establish whether point P lines inside triangle(A,B,C) boolean PinT(A,B,C,P) {return (right(A,B,P)== right(B,C,P)) && (right(A,B,P)== right(C,A,P)) ;} A B C P A B C P
19
19 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Q9 Write the geometric formulation of a test to assess whether point C lies in the relative interior of edge (A,B). boolean PinE(A,B,C) {return … ;} AB C
20
20 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 R9 Write the geometric formulation of a test to assess whether point C lies in the relative interior of edge (A,B). boolean PinE(A,B,C) {return (R(AB) AC==0) && (0 < AB AC) && (AB AC < AB AB) ; } AB C
21
21 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Q10 Write the geometric formulation of a test to assess whether the closed edges (A,B) and (C,D) are disjoint (no intersection). boolean disjointEdges(A,B,C,D) { return …}
22
22 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 R10 Write the geometric formulation of a test to assess whether the closed edges (A,B) and (C,D) are disjoint (no intersection). boolean disjointEdges(A,B,C,D) { return (right(A,B,C) == right(A,B,D)) || (right(C,D,A) == right(C,D,A)) }
23
23 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Q: Point in polygon test How to test whether a point Q lies in polygon P? Q P A B C D
24
24 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 R: Point in polygon test How to test whether a point Q lies in polygon P? Construct a ray R from Q that does not hit any vertex Compute the number x of intersections or R and bP –One edge at a time, in any order –Works even if P has holes or several components Return x %2 == 1 Q P A B C D R
25
25 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 Q11 (bonus) Write the test to assess whether ray (Q,T) intersects edge (A,B) boolean rayEdgeHit(Q,T,A,B) {return …} Q B R T A
26
26 www.gvu.gatech.edu/~jare k Jarek Rossignac, 2008 R11 Write the test to assess whether ray (Q,T) intersects edge (A,B) boolean rayEdgeHit(Q,T,A,B) {return QA R(T) != QB R(T) & R(AB) AQ != R(AB) T } Q B R T A Is this correct? How to verify???
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.