1 jare k jarek rossignac, 2008 practice quiz next time –geometry –topology one quiz will not...

26
1 www.gvu.gatech.edu www.gvu.gatech.edu /~jarek /~jarek Jarek Rossignac, Jarek Rossignac, 2008 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

Upload: prosper-alexander

Post on 08-Jan-2018

216 views

Category:

Documents


1 download

DESCRIPTION

3 k Jarek Rossignac,  2008 Q1  S = [2,3[ + ]3,4[ + [5], What is S.i (interior)?

TRANSCRIPT

1www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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

2www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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.

3www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

Q1 S = [2,3[ + ]3,4[ + [5], What is S.i (interior)?

4www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

R1 S = [2,3[ + ]3,4[ + [5], S.i = ]2,3[ + ]3,4[

5www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

Q2 S = [2,3[ + ]3,4[ + [5], What is S.b (boundary)?

6www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

R2 S = [2,3[ + ]3,4[ + [5], S.b = [2] + [3] + [4] + [5]

7www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

Q3 S = [2,3[ + ]3,4[ + [5], What is S.k (closure)?

8www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

R3 S = [2,3[ + ]3,4[ + [5], S.k = [2,4] + [5]

9www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

Q4 S = [2,3[ + ]3,4[ + [5], What is S.r (regularization)?

10www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

R4 S = [2,3[ + ]3,4[ + [5], S.r = S.i.k = [2,4]

11www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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.

12www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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≠

13www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

Q6 Let vector V have coordinates <x,y>What are the coordinates of R(V)?

14www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

R6 Let vector V have coordinates <x,y>R(V) = <-y,x>

VV

R(VR(V))

Assuming Y goes Assuming Y goes downdown

15www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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

AA BB

CC

16www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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

AA

R(AB)R(AB)

BB

CCACAC

17www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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 … ;}

AA

BB

CC

PP

18www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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)) ;}

AA

BB

CC

PP

AA

BB

CC

PP

19www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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 … ;}

AA BB

CC

20www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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 < ABAC) &&

(ABAC < ABAB) ; }

AA BB

CC

21www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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 …}

22www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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))

}

23www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

Q: Point in polygon test How to test whether a point Q lies in polygon P?

QQ

PP

AA

BB

CC

DD

24www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 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 == 1QQ

PP

AA

BB

CC

DD

RR

25www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

Q11 (bonus) Write the test to assess whether ray (Q,T) intersects edge (A,B)

boolean rayEdgeHit(Q,T,A,B) {return …}

QQ

BB

RR

TT

AA

26www.gvu.gatech.eduwww.gvu.gatech.edu/~jarek/~jarek

Jarek Rossignac,Jarek Rossignac, 2008 2008

R11 Write the test to assess whether ray (Q,T) intersects edge (A,B)

boolean rayEdgeHit(Q,T,A,B) {return QAR(T) != QBR(T)

&&R(AB)AQ != R(AB)T

}QQ

BB

RR

TT

AA

Is this Is this correct? correct?

How to How to verify???verify???