Unformatted text preview: utput: a sequence L = (c1 , c2 , . . . ch ) of ver tices of
C H(P ) in counterclockwise order
Example: L = (p3 , p4 , p8 , p6 , p1 , p5 ) p6 p1 p8
p2 p7
p4 p5
p3
C H(P ) Introduction, Convex Hulls – p.13/40 CONVEX Characterizationization
HULL  Character
The directed edge (p, q ) is an edge of C H(P ) iff q
p C H(P ) CONVEX CharacChaization tion
HULL  ter racteriza
The directed edge (p, q ) is an edge of C H(P ) iff q
p
r −
all r ∈ P \ {p, q } lies to the left of line pq (oriented by →).
pq CONVEX HULLrization
Characte PROBLEM
The directed edge (p, q ) is an edge of C H(P ) iff q
p
r ∀r ∈ P \ {p, q } the triangle (p, q , r) is oriented counterclock wise. Introduction, Convex Hulls – p.16/40 OCONVEX HULL t
rientation tes
We denote
C C W (p, q , r) = xp xq xr
yp yq yr
111 = (xq − xp )(yr − yp ) − (xr − xp )(yq − yp ) Triangle (p, q , r) is counterclockwise iff C C W (p, q , r) > 0.
How fast can we perform this test?
2 multiplications and 5 subtractions
takes O(1) time CONVEX HULL  tNaive Aithrithm
Firs algor lgo m
Algorithm SlowConvexHull (P)...
View
Full Document
 Fall '08
 UNGOR
 Algorithms, Data Mining, Databases

Click to edit the document details