Convex hulls of piecewise-smooth Jordan curves

Convex hulls of piecewise-smooth Jordan curves

JOURNAL OF ALGORITHMS Convex 8,66-94(1987) Hulls of Piecewise-Smooth A. SCHKFFER* ALEJANDRO Department of Computer Jordan Curves Science, Stan...

1MB Sizes 105 Downloads 153 Views

JOURNAL

OF ALGORITHMS

Convex

8,66-94(1987)

Hulls of Piecewise-Smooth A. SCHKFFER*

ALEJANDRO Department

of Computer

Jordan Curves

Science, Stanford

University,

Stanford.

California

94305

AND CHRISTOPHER A T & T Bell Laboratories,

J. VAN WYK

Murray

Hill, New Jersqv 07974

Received July I.1985

Several linear-time algorithms for finding the convex hull of a simple polygon in the plane are known. This paper extends a linear-time algorithm for polygons to a linear-time algorithm for input that includes smooth, convex, curved edges, such as conic sections. 0 1987 Academic Press, lnc

1. INTRODUCTION Determining the convex hull of n points in the plane requires Q(n log n) time when quadratic tests are allowed [ll], and this lower bound has been achieved [5]. Algorithms with better performance are known for some special cases. For example, four papers [l, 6, 9, lo] give linear-time algorithms for finding the convex hull of the ordered vertices of a simple polygon, and hence of the polygon and its interior. These algorithms rely implicitly on the fact that the convex hull of a planar set K is the largest set contained in every half plane containing K. The core of the algorithms is a fast method for computing the half planes whose boundary lines define the convex hull. This paper shows that even if curves more general than line segments-such as conic sections-are allowed as edges of the input, the bounding half planes that determine the convex hull of the figure can be computed quickly using a generalization of the method of Graham and Yao [6]. *Some of this work was done while A. A. Schlffer was a summer employee of AT&T Bell Laboratories; during the academic year his work is funded by a National Science Foundation Graduate Fellowship and by National Science Foundation Grant NSFDCR 83-00984.

66 0196-6774/87 Copyright

$3.00

0 1987 by Academic Press. Inc. in any form reserved.

All rights of reproduction

CONVEX

HULLS

OF

CURVES

67

Section 2 begins with definitions of notation that will be used throughout the paper, then presents an edge-based version of the endpoint-based algorithm of Graham and Yao for computing the convex hull of a simple polygon in linear time. Section 3 defines the problem of computing the convex hull of a sequence of smooth edges that form a simple closed curve and shows how the algorithm of Section 2 can be changed to solve it with no asymptotic time penalty. Section 2 is written with an eye to its generalization to the problem of Section 3. Both sections include explanations of cases that arise during computation, the algorithms themselves, and informal sketches of the proofs of correctness. Section 4 uses the formal mathematical framework of Sections 2 and 3 to give a precise characterization of the half planes that bound the convex hull and a proof of the algorithm’s correctness.

2. A LINEAR-TIME

ALGORITHM FOR SIMPLE POLYGONS

Motivation The convex hull of a simple polygon is itself a polygon, all of whose vertices are also endpoints of edges of the original polygon. Thus algorithms for the case of simple polygons can compute with just the endpoints of the input polygon: the convex hull has been determined completely once the identity and order of the vertices on the convex hull is kIlOWll.

In contrast, the convex hull of a region whose boundary is curved generally includes nontrivial pieces of that boundary. Any algorithm for the more general problem must compute with the edges that compose the region boundary. The algorithm in this section computes the convex hull of a simple polygon by computing with its edges. We also present in this section definitions, functions, and informal explanations of the lemmas used in the proof of correctness; these are special cases of their more general companions in Sections 3 and 4, but they are easier to state and to grasp in this special case. Definitions All points in this paper are in the Cartesian plane. Let x and y be two points. The closed line segment between x and y is denoted L(x, y); if x and y are distinct, then HP(x, JJ) denotes the closed half plane bounded by the line that contains x and y and that contains any counterclockwise circular arc from x to y. Throughout the paper a subscript 0 on a set S

68

aP

SCHAFFER AND VAN WYK

FIG. 2.1. The solid lines show a sample P with n = 13. The dashed lines and the pieces of that connect them form ac.

denotes the union of all open subsets of S; for example, L,(x, y) is the open line segment between x and y. If S is a closed set, aS denotes the boundary of S, S \ So. Let P be a closed planar region whose boundary is a simple polygon. Let (uJ0 < i < n) be the endpoint sequence of aP in counterclockwise order. In this paper, all arithmetic in subscripts is performed modulo n. Define ej = L(uj, uj+& the jth edge of P. Thus, aP is the set { eJ0 zz i -c n}. Let C be the convex hull of P. The problem is to produce K. As in [6] suppose two distinct endpoints s = u0 and i = u,, I are known to lie on aC; aC is computed in two convex pieces, each of which lies entirely in one of the closed half planes determined by the line through s and f. (In Fig. 2.1, we could choose s = u, and t = ug, with m = 8). Let S = HP(s, t) and D = C n S. Then aD is the boundary of the convex hull of S n { ej10 5 j < m } ; the endpoints of the polygon aD are the endpoints of aC that lie in S. Functions

Recall that if K is any convex set then any point x E sly is on the boundary of a closed half plane that contains K [4]. The boundary is called a Zinc of support. The algorithm uses functions suppi(q, ur), supp,(a,, u2), and psupp(u,, Us), where ui and u, are edges. (Type edge in the algorithm includes edges of P and the line segment L(s, t).) The next paragraph explains how to compute the values of these functions in many different

CONVEX

HULLS OF CURVES

69

FIG. 2.2. Three of the casesin the definition of psupp.The fringe indicates HP( p, q) in all three figures.

cases that can arise in executing the algorithm. The case that motivates these definitions is when the arguments are disjoint and not collinear; there are two candidates for line of support of the two edges, and only one has the correct orientation to be the value of psupp. For the first two cases to be well defined, we must know that when one of the arguments to psupp is L(s, t) then the other argument does not lie entirely in HPo(t, s); this is shown in Section 4. (i) If ui = L(s, t), psupp(a,, u2) returns HP( p, q) where p = t, q E 02, and (~1u

02

= WP,

q>.

(ii) If u2 = L(s, t), psupp(u,, u2) returns HP(p, q) where p E ul, q = s, and q u u2 c HP(p, q) (Fig. 2.2a). (iii) If ur and u2 are disjoint and not collinear, psupp(q, u2) returns HP(p, q) where p E ur, q E u2 and ur U u2 c HP(p, q). (iv) If two edges share an endpoint but are not collinear, viz. u1 = L(x, y) and u2 = L(y, z), there are two cases; if ur U u2 C HP(x, z), let p = x and q = z (F ig. 2.2b); otherwise let p = x and q = y (Fig. 2.2~); psupp(~,, u2) returns HP(p, 4). (v) If ui and a, are collinear, psupp(u,, u2) returns HP( p, q) where p E ui and q E u2. Function supp,(u,, u2) returns p and supp,(u,, u2) returns q, where p and q are as in the computation of psupp(u,, u2); if there is a choice for p and q, the supp functions choose them so that the distance along aP counterclockwise from q to p is m aximized, except that when ur = L(s, t),

70

SCHjiFFER

AND

VAN

WYK

suppI returns t, and when (r2 = L(s, t), supp, returns s. Notice that supp, and supp, always return endpoints of aP. Function angle(u;) returns the interior angle at endpoint ui.

Algorithm

Implicit

_ Hull

for Polygons

Algorithm Implicit-Hull maintains a stack Z of edges of P; in addition to the standard stack operations push, pop, and top, Z supports the operation next to refer to the second element on the stack, as in [6]. After the algorithm has been executed, stack Z contains h edges of P from which it is possible to construct aD, hence the name implicit hull. To make the logical structure of the main loop clear, we write complicated logical conditions and involved computations as separate functions that return boolean values. The meanings of the various boolean flags are explained in the proof sketch that follows the algorithm. Line numbers correspond to those used in the general version of the algorithm in Section 3, which are used in the proofs in Section 4. 1 2 3 4 5 6

Implicit-Hull ((ej]O ~j I m), s, t, I:) edge array (ej10 ~j I m) point s, t integer i stack Z boolean pop -occurred, top -inverted, in -pouch

7 boolean function push -condition 8 begin 9 if pop -occurred then return true 11 if in-pouch then return false 12 return top _ inverted or 13 ei c PsuPP(UK t), top) or 14 (vi = supp,(l(s, t), top) and angle(u,) > TIT) 15 end 16 function set _ booleans 17 begin 18 top-inuerted + ui = supp,(l(s, t), top) and u,+ 1 = suph(top, next) 22 in-pouch +- ui+ 1 = supp,(top, next) and 23 c psupp(top, next) and ei+l 28 angle(oi+,) > II end 29

CONVEX

FIG. 2.3. Input to Implicit-Hull

HULLS OF CURVES

71

with n = 12, showing the location of s and r.

30 begin

31

Z +- 0; push(L(s, t))

32 33

it0 top-inverted + false; in-pouch while i I m do begin pop _ occurred + false

+ false

34 35 36 while next # 0 and 37 e, C psupp(top, next) do begin 38 POP 39 pop-occurred + true 40 end 41 if push-condition then begin 42 while next # 0 and top c psupp(e,, next) do 43 POP 44 PusMe,) 45 set_ booleans 46 end 47 i+-i+l 48 end 49 end Processing (e,lO I i I 7) of the polygon of Fig. 2.3 illustrates the operation of the algorithm. The first edge pushed is e2. Edge e3 causes a pop at line 38, and is then pushed. Since e3 is inverted, e4 is pushed, and causes e3 to be popped at line 43. When e4 is on top it is not inverted; e5 causes no pops, and does lie in psupp( L(s, t), top), but it is pushed because of the test at line 14. Edge e6 is pushed by the test at line 13, and it causes e5 to be

72

SCHiiFFER

AND

VAN

WYK

popped. Edge e7 causes no pops and is not pushed, and Implicit-Hull halts. Proof

Sketch

For 0 I i
CONVEX

HULLS

OF

CURVES

13

Indeed, it is revealing to consider what happens at top as we ponder how to close the convex figure by connecting around to t and then back to s. If suppi(top, next) precedes supp,( L(s, t), top)-i.e., the ordering property of the stack “wraps around” and also holds on the triple (next, top, L(s, t)) -then we can simply use line segments to connect suppz(top, next) to suppi(top, next) to supp,(l(s, t), top) to t. But it is possible for supp,(top, next) to follow supp,(l(s, f), top). (An example is when the input to the algorithm is Fig. 2.3 and edge e3 = L(u,, u4) is pushed onto Z.) If this happens, we say that top is inverted, because if we follow the connection procedure outlined above we trace over top in a direction opposite to its orientation as a member of 8P. When top is inverted, aP must eventually surround top to reach t; this follows from the simplicity of aP and the fact that s lies on the convex hull: the only ways to reach t are to go around s, to pass through trace(s, supp,(l(s, t), top)), and to surround top; the first is impossible since s E aC, and the second is impossible since aP is simple. Let R be the region bounded by trace(t, supp,( L(s, t), top)) and L(t, supp,(l(s, t), top)) when top = ei; R is contained in the intersection of the planes of support determined by consecutive stack elements. We will be concerned with the interior of R; note that this region might not be connected. To preserve the truth of (*), we use the following result about the location of edges processed since top was pushed (more precisely, aP from supp,(l(s, t), top) through the later endpoint of the last edge processed); for brevity, we state the result only for the case when some edge has already been pushed on top of L(s, t). One of three possibilities holds: (i) these edges lie in the interior of R; the only way to break out of R is to cross L(t, supp,(l(s, t), top)); (ii) these edges lie in the interior of the top implied pouch, outside of R; the only way to break out of the top implied pouch is to cross its top; (An example occurs in Fig. 2.1 when e3 is on top of the stack; edge e6 breaks out of the pouch.) (iii) top is inverted and these edges lie outside R and outside the top implied pouch; in this case we push the next edge. Algorithm

Construct _ Hull

for Polygons

A sequence of edges that implies a sequence of maximal pouches whose support points are properly ordered is an implicit hull. Given an implicit hull, one can construct the boundary of its convex hull simply by filling in pieces of aP-edges-and segments that serve as the tops of pouches. A version of algorithm Construct -Hull that does this for polygons is pre-

14

SCHiiFFER

AND

VAN

WYK

sented below; it relies on the fact that the only possible nonempty intersections of an edge with the convex hull boundary are in an endpoint or in the whole edge. Running Construct - Hull on the stack resulting from Implicit-Hull gives the boundary of the convex hull of D. Because of the order in which edges appear on the stack, the hull boundary JD is constructed from t clockwise around to S. Note that the segment L(s, t) is output if and only if it is the only element of the stack, since this is the only situation in which L(s, t) lies on X. 1 Construct-Hull 2 stack Z

(8, S, t)

3 Point s, t, ply p2, op2

4 edge E 5 begin 6 E + L(s, t) 7 8 9

OP2 +

t

while top # 0 do begin ~1 + supp,(E, top)

10

~2 +

11

if op, # p1 then output JXOP,, if p1 f p2 then

12 16 17 18

supp,(E,

output OP2 +

top)

L(P,Y

PI> P2)

P2

19

E + top 20 POP 21 end 22 if op2 # s then 23 output L(op,, s) 27 end

3. EXTENSION

TO JORDAN

CURVES

Preliminaries

Let P be a closed connected region in R2 and suppose aP, the boundary of P, is a Jordan curve composed of n edges (e,lO I i < n) that intersect only at their endpoints and are such that for each edge ei and any point p E ei, there exists a unique tangent line through p that supports ei (see Fig. 3.1). An edge of 8P is either a line segment or a curve that has no pieces of constant slope; furthermore, no line intersects a curved edge of JP in more

CONVEX

HULLS OF CURVES

75

FIG. 3.1. A sample P with n = 10. The dashed lines and the pieces of aP that connect them form the boundary of C.

than two points. The line passing through both endpoints of an edge of aP defines a half plane that contains the edge; we call the line segment between an edge’s endpoints its extremal chord. Given an edge e;, we use the notation CH(e,) to denote its convex hull, which is bounded by e, and its extremal chord. Let the sequence of edge endpoints of iJP be (~~10 I i c n) in counterclockwise order, where ui and u~+~ are the endpoints of ei. Let C be the convex hull of P. We assume that the following can be computed in constant time: (i) for each edge, whether it crosses a given line, (ii) for each edge, the unique tangent at any point on it, (iii) for any two edges, the (at most four) common tangents, (iv) for each endpoint ui, the internal angle, angle(u,). In contrast to the polygon case, possible values of internal angles of Jordan curves include both 0 and 2~.

76

SCHAFFER

AND

VAN

WYK

FIG. 3.2. The fringes show the half plane S; the dashed lines, together with pieces of edges that lie in S, form the boundary of D.

These requirements appear stringent, but they are readily satisfied if the edges that compose the boundary are familiar curves like pieces of conic sections or splines of low degree. This section extends the algorithms of Section 2 to compute C using O(n) such operations. As in Section 2 the input includes two distinct points s and r known to be in 8C n 8P. If the edges are conic sections, for example, s and t could be computed analytically as extreme points along one direction. Note that s and t need not be the endpoints of an edge of cYP.As before, the convex hull is computed in two convex pieces, each of which lies entirely in one of the closed half planes determined by the line through s and t; the convex hull of P is the union of these two pieces. Let S = HP(s, t) and D = C n S. Assume without loss of generality that the edges are numbered so that s E e, and t E e,; if s is an endpoint, e, is the edge emanating counterclockwise from s; if t is an endpoint, e, is the edge emanating clockwise from t (see Fig. 3.2). Note that e, may be the same as e, in the case of Jordan curves. The boundary of D, aD, is the boundary of the convex hull ofSnlJ O<, S ,ej. This section gives an algorithm to compute aD.

CONVEX HULLS OF CURVES

b

p:9=Y

ITTTTT

FIG. 3.3. ‘Ihe results of supp and psupp in several cases

Functions

As in Section 2, the construction uses three functions supp,(a,, uz), supp,(a,, uz), and psupp(u,, Us), where ui and u2 are edges. Section 4 proves that these functions are not called when one argument is L(s, t) and the other lies entirely in HPo(t, s), nor are they called when one argument lies entirely inside the convex hull of the other, so they are well defined. (i) If ui = L(s, t), then p = t, q E a,, such that L(s, t) u a, c I-W P, 4).

(ii) If uz = L(s, t), then p E ui, q = s, such that ui u L(s, t) c I-=‘( P, 4).

(iii) If ui and a, do not share an endpoint, then there exist distinct points p E u1 and q E u2 such that HP(p, q) supports ui U u2; psupp(u,, u2) returns HP( p, q) (Fig. 3.3a). Function psupp is well defined in this case because HP( p, q) is unique (although there may be a choice of p and q): to see this, suppose two half planes HP( pl, ql) and HP( p2, q2) support ui U u2 with pi E ui and qi E a,; if HP(p,, ql) strictly contains HP( p2, q2), then ui and a, cannot intersect aHP( p,, qJ, contrary to

78

SCH;iFFER

AND

VAN

WYK

assumption; if the boundaries of the half planes cross at a point between pt and ql, then either pr 4 ut or q1 $Cu2, again contrary to assumption: finally if the boundaries of these half planes are parallel or cross outside the segment Up,, ql), and q U (Jo c WP,, qJ, then ul U u2 C fWq2, p2) -the half plane is oriented backwards, which is also a contradiction. Another way to look at this is to note that there are at most two supporting lines of ui u u2, and one of these has the set on the wrong side. (iv) If ur and u2 share an endpoint y, and it is possible to choose E ui and q E a, such that y $L {p, q} and HP(p, q) supports ut U u2, psupp returns HP( p, q) (Fig. 3.3b).

p

(v) If crt and u2 share an endpoint y, but it is not possible to choose p and q as above, there are two possibilities for the value of psupp(u,, u2): the half plane E such that t3E is tangent to ut at y, or the half plane F such that i9F passes through both endpoints of ur. If E supports ui U u2, psupp returns E, setting p = q = y (Fig. 3.3~); if E does not support ut u u2 then F does, and psupp returns F, setting q = y and p to the other endpoint of ur. The line bounding the half plane returned by psupp may be a common tangent to both edges, a line through an endpoint of one edge and tangent to the other, or a line through endpoints of both edges. Since operations to compute all these lines were assumed to have been given, psupp can be computed in O(1) operations. A less formal way to think of this computation is to imagine some creature standing at the first endpoint of u2 moving toward ut seeking a line of sight that touches both edges and lies to their right; the line of sight it finds first is the boundary of the half plane computed by psupp. Function supp,(u,, a,) returns p E ui and function supp,(u,, u2) returns q E u2 corresponding to p and q in the computation of psupp(u,, u2). There may be more than one way to choose p and q, as for example when one of the edges is collinear with the line bounding HP( p, q); supp, and supp, return points p and q that maximize the length of the path trace(q,

P).

(The reader is invited to check that these definitions of psupp and the supp functions are consistent with those given in Section 2.) Given x, y E aP, define trace(x, y) as the portion of ilP encountered in a counterclockwise traversal of ii’P from x to y. This is a natural generalization of the trace function defined in Section 2, which was defined only when x and y were endpoints of edges of 8P. If trace(p, q) c HP(q, p), then trace(p, q) is a pouch; we define trace( p, p) to be the trivial pouch consisting of point p. With the added proviso that an implied pouch may be trivial, the definitions of pouch top

CONVEX

HULLS

OF

(d FIG.

would

3.4. In both in-top-edge

(a) and (b), the curved be set true.

79

CURVES

(b)

edge is an antipouch.

However,

only in case (a)

and interior, and the notion of the pouch implied by an ordered pair of edges, carry over from Section 2. The significance of a pouch trace( p, q) is that no part of 6’P that lies in its interior can lie on X. Given an edge E = trace( ui, ui+ i), call the open finite region bounded by E and its extremal chord E’s interior. If trace(ui, ui+i) is a pouch, E’s interior is simply its interior when it is viewed as a pouch. If trace(u;, u~+~) is not a pouch, we call E an antipouch. No part of I~P that lies in the interior of an edge-whether it is a pouch or an antipouch-can lie on aC. Whereas the polygon algorithm merely had to detect the boundary’s entry into a pouch formed by at least two preceding edges, the generalized algorithm for Jordan curves must also detect entry into the pouch or antipouch created by the top edge. Some care is needed in applying one’s intuition to understand the algorithm’s setting of variables in-pouch and in- top-edge. For example, in the case of polygons, in-pouch was set true whenever an edge entered a pouch. But a curved edge can enter a pouch and leave it immediately (by crossing its top); even though such an edge enters a pouch, it does not cause in-pouch to be set true. As another example, the only antipouches that can cause in _ top _ edge to be set true are those whose interior is disconnected from the region bounded by truce(t, supp,(l(s, t), top)) and L(t, supp,(l(s, t), top)) (Fig. 3.4). The setting of in- top-edge vis-a-vis the setting of in-pouch also merits discussion. An edge can lie in the pouch formed by the top edge, but that pouch could be part of the pouch implied by (next, top). If this happens the algorithm usually sets in-pouch to true and in-top-edge to false. An exception occurs when the pouch formed by top is the pouch implied by (top, next): this can, but need not, cause both in- top-edge and in-pouch to be set true. Pouches and antipouches are identified with the help of functions cw and ccw.

80

SCHiiFFER

AND

VAN

WYK

(i) The value of cw(e,) is true if and only if e, n HPo( ui+i, ui) # 0. (ii) Function ccw(e,) is true if and only if ej n HP&u,, ui+i) # 0. If edge e, is curved then exactly one of cw( e,) and ccw( ei) is true; if edge ei is a line segment then both cw(e,) and ccw(e,) are false.

Algorithm

Implicit

-Hull

for Jordan

Curves

Here is the extended version of algorithm

Implicit-Hull.

1 Implicit-Hull ((ej10
10 11 12 13 14 15

boolean function push -condition begin if pop-occurred then return true if in- top-edge then return e, c CH(top) if in-pouch then return false return top _ inverted or e, C psupp(Us, t), top> or (vi = supp,(l(s, t), top) and ang/e(vi) end

> T)

16 function set _ boofeuns 17 begin 18

top -inverted

+

not 19 20

truce(supp,(top, next), supp,(l(s, t), top)) C top in _ top-edge + (ccw (top) and top-inverted) or (cw(top) and vi = supp,(top,next) f supp,(l(s, t), top) # ui+i)

21

in-pouch

22. 23 24 25

if supp,(top, next) # supp,(top, next) and c psupp(top, next) then eitl if supp,(top,next) # vi+i then in-pouch + cw(top) else in-pouch + (cw(top) and angle(vi+,) 2 a) or (not cw(top) and angle(v,+,) > rr) end

26 27 28 29

+ false

CONVEX

HULLS

OF

81

CURVES

30 begin

31

Z + 0; push(l(s,

32 33 34 35

i + 0; top-inverted + false; in-pouch while i I m do begin pop-occurred + false

t)) + false; in-top-edge

36 37 38 39

while next # 0 and ei c psupp(top, next) do begin POP

40

end if push _ condition then begin while next + 0 and top c psupp(e,, next) do POP PushCeil

pop-occurred

+ false

+ true

41 42 43 44 45 set _ booleans 46 end 47 i+i+l 48 end 49 end

The test e, QZCH(top) at line 10 can be implemented in terms of the required primitive operations by testing whether e, crosses the extremal chord of top and, if not, whether an interior point of ei can be expressed as a convex combination of one endpoint and another point of top. The setting of top-inverted at line 18 can be implemented by beginning the computation of the required trace, terminating with false if the computation ever leaves edge top. Further

Proof Sketch

Only one of the loop invariants for the polygon algorithm of Section 2 needs to be modified to apply to this algorithm. The stack contents still imply a sequence of maximal pouches, and the support points are still properly ordered. But the description of the location of the piece of i9P that follows supp,(l(s, t), top) must be modified because this piece can include partial edges; furthermore, there is an additional possibility for the location of this piece of aP: it can lie in the convex hull of the top edge, whose interior is disconnected from the region bounded by tra@t, supp,(Us, t), top)) ad Ut, su~p~(Us, t), top)). No part of aP in a pouch interior can be on K. Once inside a pouch aP can spiral around many times, and in particular the edges could be oriented so as to make later conditions in push-condition true. If an edge that lay entirely in a pouch interior were ever pushed onto the stack, the ordering of

82

SCH;iFFER

AND

VAN

WYK

support points would not be preserved, and subsequent calls to psupp might be vitiated by being given arguments that lie entirely in HP,(t, s). If aP enters a pouch by crossing its top, it is detected at line 37, and the pops it causes remove (at least) the later of the edges that imply the pouch. It is also possible that the first edge of aP after an edge just pushed onto the stack curves back into the pouch implied by (next, top) without crossing the pouch top. Lines 21-28 test for this event, and we discuss the test below. First, however, note that if dP does enter a pouch this way and remains in its interior, then the first edge to exit the pouch is detected at line 37 because it crosses the pouch top, so it will be pushed because it causes a pop at line 38. After the edge exiting the pouch is pushed at line 43, the value of in-pouch is computed with respect to the new pouch implied by the two edges now at the top of the stack. We now discuss the test for this type of pouch entry at lines 21-28. Line 22 checks that the pouch implied by next and top = ei is nontrivial, and line 23 that the edge after top, e,+i, is in the half plane that contains the pouch and whose boundary includes the pouch top. If either of these tests fails, ei+i cannot lie entirely in the top implied pouch. In order for e, + i to enter the top implied pouch without crossing its top, must curve back between the part of dP on the pouch boundary and ei+l the pouch endpoint supp,(top,next). If this point is not u,+i, the shared endpoint of top and e,+i, then e,+i is in the pouch if and only if traceo(supp,(top, next), ui+J is contained in the pouch interior. This containment can be checked by examining the orientation of top. Recall our convention that any (circular) arc from supp,(top, next) to supp,(top, next) in psupp(top, next) is oriented counterclockwise. If top goes clockwise, then it curves away from supp,(top, next), and therefore into the pouch, while if top goes counterclockwise, it must curve outside the part of aP contained in the pouch boundary. If the point supp,(top,next) is the shared endpoint ui+i, and e,+i does not cross the pouch top, then dP enters the pouch if and only if the interior angle at u,+i includes at least a half plane, so this is the test implemented. The distinction between strict and lenient inequality of angle at lines 27 and 28 matters only when both ei and e,+i are tangent to a psupp(top, next) at supp,(top, next). When the interior of the top edge is disconnected from the interior of the region bounded by trace( l, supp,( L(s, t), top)) and L(t, supp,( L(s, t), top)), whether as a pouch or an antipouch, the meanderings of b’P in such a region could also distort the results of psupp tests. Suppose the edge that succeeds top lies entirely in CH(top); if top goes counterclockwise and is inverted, i.e., top disconnects the interior of D, then dP enters and remains in the disconnected interior of an antipouch for at least one edge; if top goes clockwise and does not lie entirely in

CONVEX

HULLS

OF

CURVES

83

psupp(L(s, t), next), then dP enters and remains in the disconnected interior of the pouch formed by the top edge for at least one edge. In either circumstance, when aP exits the convex hull of the top edge, it must cross the edge’s extremal chord, and thus leave the convex region defined by the stack contents. To preserve the inductive assertion about the location of the piece of ilP that follows supp,( L(s, t), top), line 10 causes this exiting edge to be pushed.

Algorithm

Construct _ Hull

for Jordan Curves

Here is the extended version of algorithm Construct-Hull. It is important to note that all calls to function trace that occur in this algorithm are used simply to compute pieces of edges of JP, so these calls perform only a constant amount of computation. 1 Construct-Hull 2 stack Z 3 4

(Z, S, t)

point s, t, pl, p2, op2

edge E 5 begin 6 7 8 9

E + L(s, t) OP2 @ t

while top # 0 do begin Pl +- supp,(E,top)

10

~2 +

11

if op2 # p1 then if trace,( pl, op2) c HP( op,, pJ then output truce( pl, op2) else output L( PI, OP2) if p, # p2 then

12 13 14 15 16 17 18 19 20

21 22 23 24 25 26 27 end

=PP,(K

output OP2 +

top)

UP,,

P2)

P2

E + top

POP end if op2 + s then if trace,(s, op2) c HP(op,, output trace( s, op2) else output L(S, opz)

S) then

SCH;iFFER AND VAN WYK

FIG. 4.1. Two casesin the proof of Lemma 1. The fringes show HP(y, x).

4. ANALYSIS The first three lemmas characterize pieces of the boundary of C. They are important in the proofs of the subsequent lemmas, which deal with the correctness of the algorithms. LEMMA

1.

Let x and y be distinct points on the same edge and in

K f~ aP, with trace(x, y) c ej. If traceo(x, y) Q HP(y, x), then trace(x, y) c aC; that is, the piece of ej betweenx andy lies on the boundary of the convex hull of P. Otherwise, L(x, y) C aC, that is, the line segment between x and y lies on the boundary of the convex hull of P. Proof Consider the open region Q bounded away from P by lines of support at x and y and the subedge trace(x, y). No point in P can lie in Q; by definition, every convex combination of x and y lies in C, and every point in P lies in C. Thus, if traceo(x, y) ct HP( y, x), then trace(x, y) c W (Fig. 4.la); otherwise, 15(x, y) c aC (Figure 4.lb). 0

Let B = 6’P n K. A point x E B is an interior point of B if B contains an open neighborhood in W of x. Points x E B that are not interior points of B are called boundary points. LEMMA 2. For any edge ej with dC n ej + 0, aC n ej are boundary points of B.

at most two points in

Proof Suppose three distinct points x, y, z E ej are boundary points of B. Assume without loss of generality that x, y, and z lie in counterclock-

CONVEX

FIG. 4.2.

HULLS

OF

Two cases in the proof

85

CURVES

of Lemma

2.

wise order on ej. By the support property of edges of P either every chord of ej contains points exterior to P arbitrarily close to its endpoints or points interior to P arbitrarily close to its endpoints, but not both. If the chords L(x, y), L(y, z) and J~(x, z) lie outside P in neighborhoods of their endpoints (Fig. 4.2a), by Lemma 1 they lie on X; but they form a triangle outside which P is known to lie and since W is simple, this is a contradiction. If the chord L(x, z) lies locally inside P (Fig. 4.2b), then the part of ej between x and z lies on aC by Lemma 1, so y is not a boundary point of B. 0 Edge endpoints in LIP n aC and boundary points of B are called vertices of K. An argument similar to the proof of Lemma 2 shows that an edge can contain at most two vertices, so the number of vertices of JC is at most 2n.

LEMMA 3. Suppose p, q E aP, trace( p, q) is a pouch, and trace,( p, q) n L(p, q) = 0. Then traceo(p, q) n X = 0. Proof: Since aP is simple, there must exist points z and w on the line through p and q such that p and q lie between z and w and such that trace(z, w) lies in HP(q, p) but outside the pouch: if trace,(q, p) or HP(q, p), w and z must exist by the Jordan curve theorem (Fig. 4.3a); if trace,(q, p) c HP(q, p), z = q and w = p by the definition of pouch (Fig. 4.3b). In either case any point on trace,( p, q) lies inside the region defined by trace(z, w) and L(z, w), and hence does not lie on K 0

86

SCHKFFER

FIG. 4.3.

AND

VAN

Two cases in the proof

WYK

of Lemma

3.

It follows from Lemmas 2 and 3 that the order of the vertices in a counterclockwise traversal of 8C is the same as their order in a counterclockwise traversal of aP. Thus we can compute the vertices of K in a single traversal of ilP, and then fill in pieces of edges or line segments between consecutive vertices using the test of Lemma 1. We now come to the crucial lemma that justifies the correctness of the algorithm by characterizing the contents of the stack of Implicit-Hull during computation. This lemma unites the cases discussed in the informal proof sketches of Sections 2 and 3. It would be interesting to discover a more compact set of invariant assertions than those given in Lemma 4; we have been unable to remove any of the conditions without leaving a statement that is too weak to prove. Moreover, we have been unable to prove any of the individual conditions separately: there are counterexamples that show that each condition is not strong enough to serve alone as an induction hypothesis. Algorithm Implicit-Hull considers the edges from s to t in boundary order. Each time the algorithm processes a new input edge the stack Z contains a subsequence of the previous input edges. The next task is to characterize that subsequence. In the following lemma, we use ii, i,, . . . , i, to denote the indices of the k edges on stack Z above L(s, t). To make it more convenient to state the lemma, we let i, = - 1 and e,,, = L(s, t). The proof also uses Pi to denote U_ i <, s ,ej and R, to denote the re-

CONVEX

HULLS

gion of finite area bounded Ut, SUPP*(L(S, t>, ei))-

by

OF

87

CURVES

trace( t, supp,( L(s, t), e,))

and

LEMMA 4. 2;’

Suppose that at line 46 the contents of stack Z are eiO = L(s, t), . If k = 0, so only L(s, t) is on the stack, then Pi c HP(t, s). If 0,’ %en the following five conditions hold:

(1) Pi c f-l 0%

j
(2)

<

for

0


k

suPP,(ei,,

ei,); ei,-l>

precedes

wm(ej,+l,

q,)

on

e,,;

(3) for 0 ~j < k, (e,,, e,,+,) implies a pouch; (4) for 0
not

the and are

Proof Suppose k = 0. By line 13, U o,,,iej c HP(t, s). Since L(s, t) c HP(t, s), we have P, c HP(t, s). For the remainder of the proof, we assume k > 0. Note that once an edge is pushed on top of L(s, t), there is always an edge on top of L(s, t) on Z; thus, the proof for the case k = 0 applies only to the edges processed before the first edge of JP is pushed onto Z. The proof is by induction on i, so first we show that conditions (l)-(5) hold for i = 0. Base Case of Induction

on i

By assumption k > 0, so k = 1 and i, = 0. Condition (1) follows immediately from the definition of psupp. Conditions (2) and (4) hold vacuously. Since s E e,, supp,(e,, L(s, t)) is either s or vi. If supp,(e,, L(s, t)) = s, the truth of condition (3) follows immediately because the pouch implied by (L(s, t), e,) is trivial. To verify condition (5), note that ccw(e,) must be true. Since s precedes any other point on e,, top -inverted is false. In turn, this means that in- top-edge is false by lines 19 and 20. Lines 21 and 22 make in-pouch false. Since all three booleans are false, the lemma is true if and only if we are in situation (5)(c); but trace(supp,( L(s, t), e,), vl) is contained in R ;, by the support property of the edges, so the lemma holds.

88

SCHKFFER

AND

VAN

WYK

If supp,(e,, L(s, t)) = or, then condition (3) follows from the definition of psupp. The verification of condition (5) is more involved than before since there are several possibilities. If e, is a line segment, then all three booleans are false and we are in situation (5)(c). If e, is a curved edge, then since the boundary of psupp(e,, L(s, t)) contains the extremal chord of e, and e, intersects HPo(s, t), cw(e,) is true; it follows from this and the assumption that suppi(eO, L(s, t)) = ui that in-top-edge is false, so we are not in situation (5)(a). Nevertheless, e,, is a pouch; if edge e, is contained in the pouch trace(s, ui), then that pouch has nonempty interior, so cw(eO) is true; moreover, e, c psupp(e,, L(s, t)), and makes an interior angle at ui of at least 71; therefore in-pouch is true by line 26 and we are in situation (5)(b). If edge e, is not contained in the pouch e,, then the choice between situations (5)(c) and (5)(d) depends on the value of topinverted. If supp,(L(s, t), e,,) = u,, then top-inverted is false, and we are in situation (5)(c). Otherwise, since ur is the last point on e, and supp,(l(s, t), eo) E e,, top-inverted is true; since trace(supp,( L(s, t), e,), ur) is not contained in Rik by the support property of the edges, we are indeed in situation (5)(d). Inductive

Step on i

Now suppose the lemma is true for i; we show that the processing of ei+ r preserves the truth of the lemma. Inductiue

Step on i-Edge

Not Pushed

If e,+i is not pushed, then it cannot cause any pops, so Z is unchanged, and conditions (2), (3), and (4) still hold. There are three cases to verify conditions (1) and (5), depending on the line from which push-condition returns false: (i) [line lo] If in-top-edge is true, then the induction hypothesis implies that we were in situation (5)(a) at line 35. Since e,,, is not pushed, c CH(e. ). Together with the induction hypothesis, this implies that zo%ition (1)‘holds and that we remain in situation (5)(a). (ii) [line 111 If in-pouch is true then the induction hypothesis implies that we were in situation (5)(b) at line 35. By line 37, etil c psupp(e+ e,,_,), and since aP is simple, we are still in situation (5)(b). Condition (1) follows from the induction hypothesis and the containment of e;+1 in the top implied pouch. (iii) [lines 12-141 By the induction hypothesis, we were in situation (5)(c) at line 35. Lines 37 and 13 imply that e,+r c psupp(ei,, e,k-,) n psupp(l(s, t), e;,). Together with the simplicity of aP and the fact that

CONVEX

HULLS

OF

CURVES

89

s E aD, these imply that we remain in situation (5)(c). Condition (1) follows from the induction hypothesis and the containment of e,+i in Rik. Each of these cases relies implicitly on Lemma 3. Note that we cannot have been in situation (5)(d) at line 35, because if we had been then e,+i would have been pushed. Inductive

Step on i-Edge

Pushed

The proof of the case when eicl is pushed depends on which line of push-condition returns true. The proof if line 9 returns true is by induction on the number of pops caused by eifl at line 38; we defer considering that case until we have disposed of the other possible causes for pushing ej+l. First, we observe that e,+i causes at most one edge to be popped during the while-loop at lines 42-43. Suppose the top three elements on the stack at line 41 are e,,, enext, and eante; we show that at line 46 the top two elements of Z are either etop and e,+i or enex, and e,+i. If etop c psupp( ei+ i, enext), then no pop occurs at line 43, and e,+i is pushed on top of em*- Otherwise, since by line 37 e,+i c psupp(e,,, enext), we have psupp(e;+i, enext) = P~~PP(G~, enA. Since (eanteYetop) does not imply a pouch by the induction hypothesis, enext c psupp( ej+ i, ea.,,), so enext is not popped at line 43, and e,,, is pushed on top of it at line 44. In the rest of the proof, we use the equality of half planes to ignore pops at line 43 when proving that condition (3) holds; that is, if etor, is popped at line 43, the pouch implied by (enext, etop) (whose existence is guaranteed by the induction hypothesis) is contained in psupp( e,, i, enext). Inductive

Step on i-Edge

Pushed-No

Pops at Line 38

The verification that condition (3) holds depends on which line of push-condition returns true. Once we have condition (3), the truth of the other four conditions follows straightforwardly. Therefore we postpone considering them until we have verified condition (3) for all lines of push -condition. If push-condition returns true from line 10, then by the induc(5)(a) at line 35, and tion hypothesis we were in situation trace(supp,(e,,, en.&, vi+i) c CH(e,,,). Condition (3) follows immediately from this and the induction hypothesis. Function push-condition cannot return fafse from line 11 on any of because the only way to push an edge when in-pouch is eik-,+l~--~ei+17 true is to pop an edge at line 38. Thus, we were not in situation (5)(b) at line 35.

90

SCHXFFER

AND

VAN

WYK

If push-condition returns true from line 12, we were in situation (5)(d) at line 35, and e,+i shares an endpoint with etor,. Condition (3) follows from the definition of psupp and the induction hypothesis. If push-condition returns true from line 13, then we were in situation (5)(c) at line 35, and e,+i 0 psupp(L(s, t), et&. Therefore e,+i n L(t, supp,(L(s, t), e,,,)) # 0; by the simplicity of aP and the fact that s E JD, trace(supp,(L(s, t>, etop), ui+l> C psUpp(er+l, et,>, so trace~~~PP2(ei+~, etoph suPPl(ei+l, etop)) is a new pouch at the top of the stack. Condition (3) follows directly from this and the induction hypothesis. If push-condition returns true from line 14, then we were in situation (5)(c) at line 35 (trivially, since uifl = supp,(l(s, t), e,,)); we have etor, n ei+l = u,+~. Since e,,, caused no pops at line 38, e,+i C psupp(e,,, enext). Condition (3) follows from this observation and the induction hypothesis. By line 37, eiL c psupp(ei,_,, eilrm2), and by line 42, eik_, GE psupp(e,,, e,,-,); together with the induction hypothesis these show that condition (4) holds; this, in turn, implies condition (2). Conditions (3) and (4), together with the simplicity of aP and the fact that s E aD, imply condition (1). We now verify condition (5). If e,+i is inverted and ccw(e,, i) is true, or if cw(e,+J is tme and vi = swdq,,~ ened f SUPP~(L(S, t), e,,) + ui+ir then in-top-edge is set true at hnes 19 and 20, and we are in situation W(a). If (efk-,, e,k) implies a nontrivial pouch inside which ei+* lies, then in-pouch is set true by the discussion following the presentation of Implicit-Hull for Jordan curves, and we are in situation (5)(b). If in _ top _ edge and in -pouch are both false, then by the support property of the edges trace(supp,(l(s, t), e,+i), Ui+2) c Ri+i if and only if topinverted is false; thus we are in either situation (5)(c) or (5)(d). Inductive

Step on i-Edge

Pushed-One

or More Pops at Line 38

We return to the case where push-condition returns true from line 9. The proof is by induction on the number of pops caused by e,+i at line 38. For the base case, suppose edge e,, is popped at line 38, and etop, enext, and eante are at the top of Z at line 41. By line 36 e,+i LZ psupp(ejl, et&, so ej, c psupp(ei+i, etop). Also by line 37, e,+i c psupp(e,,, en&. By the induction hypothesis, (e,,,, ej,) implies a pouch, and trace(supp&, et& suppl(eilY e,,,)) C PsuPP(ei+ 1Y e,,r); since trace(suPP,(e,+i, ej,),suP~i(ei+i, ej,)) C PsuPP(ei+i, e,&, it follows that (e top, e,+i) implies a pouch, and condition (3) follows from the induction on i. Now suppose that the lemma is true if k’ - 1 edges are popped at line 37, and suppose edges e.,l,. . . , ejk, are popped at line 37. We show that the lemma remains true. By the inductions on i and on k’, (etop, e,,) im-

CONVEX

HULLS

OF

CURVES

91

plies a pouch, and (ei,, e,+J implies a pouch. It follows that tractisw2(ej+,9 etwh wp,(ej+l, et,>) C Psupp(ei+,, et&, ad condition (3) follows from the induction on i. Conditions (l), (2), (4) and (5) can be verified using the same techniques as when push -condition returns true from a line other than 9. •I Throughout the proof of Lemma 4 we assumed implicitly that all of the ,calls to the functions psupp, supp,, and supp, were well defined. The only difficult steps in verifying this assumption are to show that the functions never get called with one edge inside the convex hull of the other and to show that if both edges are on the stack then they have some point in HP(s, t). The second of these is important because if we allow consecutive stack elements to imply a pouch whose top goes into HP,(t, s), we could subsequently push edges that are entirely contained in HP,(t, s). When e, is considered, the only call occurs in push-condition at lines 13 and 14 with both arguments as L(s, t). Thereafter we maintain the two claims as inductive assertions assumed to be true for all the calls made while considering e,, . . . , ei, and consider the calls made while considering ei+ i. The crucial observation is that one can strengthen part 3 of the lemma by saying that the pouch top is in HP(s, t). Part 1 of the lemma asserts that Pi, which includes L(s, t), is contained the half planes implied by each of the pouch tops. Thus none of the pouch tops can cross L(s, t). Furthermore, the pouch tops cannot cross the line through s and t outside L(s, t) because s and t lie on the convex hull of P. Since the top of the pouch implied by L(s, t) and ei, must be in HP(s, t), all of the other pouch tops must also be in that half plane. If no edges are on the stack, the only calls are again at lines 13 and 14. If there are edges on the stack, the first call is in the pop test at line 37. This call is fine because next and top are known to imply a maximal pouch. This argument also covers the calls at line 22-24, which are made only if e,+t does get pushed. If e,+i is in the convex hull of a previously seen edge then in-pouch or in-topedge will be true and push-condition returns false, so no more calls to psupp, supp,, or supp, are made. The calls at lines 13 and 14 both have L(s, t) as an argument and we know that s and t are on the convex hull, so the segment L(supp,(L(s, t), top), supp,(l(s, t), top)) must be entirely in HP(s, t). The only remaining call is at line 43. Since ei intersects HP(s, t), that call to psupp is well defined. This shows that all calls to psupp are well defined. When algorithm Implicit-Hull finishes, we must be in situation (5)(c). Since the stack contents satisfy condition (1) of the lemma, and 6’P is simple, we can construct a convex polygon that contains P n S by taking appropriate pieces of the boundaries of the half planes that support consecutive elements, where now L(s, t) is also considered to follow the top

92

SCHXFFER

AND

VAN

WYK

edge of the stack. To construct the actual convex hull of P n S, we use Lemma 1 to fill in pieces of edges of aP. LEMMA 5. Construct-Hull

If

the stack X contains an implicit hull for D, then (Z, s, t) outputs the part of JD that lies on aC. L(s, t) is output if and only if it is the only item on the stack. Proof. The output of algorithm Construct-Hull is a sequence of line segments that support P, as well as subedges and chords of edges of P that lie on I’D. By Lemmas 1, 2, and 3, the task of computing that part of JD that lies on JC can be accomplished by filling in the line segments or subedges of P connecting consecutive vertices of aC n D. Functions supp, and supp, are defined so that p1 and p2 are assigned (at lines 9 and 10) to consecutive vertices unless the segments e and top have a common endpoint, p, which is also a vertex of X n D. In this second case, both p1 and p2 will be assigned to p. After line 18 is reached for the first time, the variable op2 stores the previous vertex computed on the current segment E. (At the beginning of the algorithm, opz is assigned to t, which might not lie on the current segment.) Since, by Lemma 2, an edge may have at most two vertices, at line 11 op2 and p1 are either the same point or consecutive vertices of G’C n D. Similarly p1 and p2 are either the same point or consecutive vertices (at line 16). If op2 and p1 are distinct they should be connected on aC by either the line segment between them or the subedge between them -trace(op,, pi)-according to Lemma 1. Line 12 implements the test given in Lemma 1, and either line 13 or line 15 gives the correct output to connect op2 and pl. If p1 and p2 are distinct vertices the supporting segment between them must be on dC by the definition of convex hull; this segment is output at line 17. When the while loop terminates, the hull boundary has been filled in from t all the way around to one vertex on the last edge of P on the stack E. If this vertex is not s, then the piece of JC between this vertex and s must also be filled in, and this is done in lines 23-26, again relying on Lemma 1. This piece will be L(s, t) if and only if op, is still t, in which case L(s, t) must have been the only item on the stack at the start of Construct -Hull. q Algorithms Implicit THEOREM. i?D in time O(m).

_ Hull

and Construct _ Hull

compute

Proof. The correctness of the algorithms follows from Lemmas l-5. The time bound on Implicit-Hull follows from the fact that each edge ( ei10 I i I m) can be pushed and popped at most once. The time bound

CONVEX

HULLS OF CURVES

93

on Construct-Hull follows from the facts that each edge on the stack is processed once, and for each edge the processing requires time O(l), where the implicit constant can be chosen uniformly for all edges. 0 5. CONCLUSION The algorithms of Section 3 can be combined to give an algorithm for computing the convex hull of a piecewise-smooth Jordan curve in linear time. We expressed them separately to simplify the exposition: keeping all pieces of the convex hull on the stack would require distinguishing common tangents from edges and a way to cut off pieces of edges on the stack. Section 2 presents a simplification of the Jordan-curve algorithm to the special case of a simple polygon. In this case an edge and its chord are identical and the tangent line to an edge contains that edge. Therefore the functions suppi, supp,, and psupp can be defined more succinctly, and the tests in the algorithms stated more simply. Nevertheless expressing the notions of trace and pouch formally for the polygon case illuminates the purpose of the tests in the more general case. All of the algorithms for the restricted case of simple polygons [l, 6, 9, lo] express tests in terms of one line segment lying to the left or to the right of another. In this paper all the tests are expressed in terms of containment in a half plane, as is customary in the study of planar convex sets [2, 4, 81. Although the requirements on the input edges ej were quite general, in practice they are often pieces of conic sections or of splines of low degree [3, 71, and the necessary tangents and intersections can be computed analytically. ACKNOWLEDGMENTS Ron Graham encouraged us to write this up carefully. Brenda Baker pointed out an error in an earlier version of Lemma 4. Al Aho saw us through several versions of loop invariant on our way to Lemma 4. Jon Bentley, Brian Kern&m, and Doug McIlroy offered insightful comments on previous drafts. The second author thanks Steve Fortune for an entertaining afternoon spent proving that the number of pieces in the convex hull of a circular-arc polygon is at most twice the number of edges in the polygon. REFERENCES 1. B. K. BHATTACHARYA AND H. EL GINDY, A new linear convex hull algorithm for simple polygons, IEEE Trans. Inform. Theory. 30 (1) (1984). 85-88. 2. T. BOTTS, Convex sets, Amer. Moth. Monthly 49 (1942), 527-535. 3. R. A. BROOKS, Model-based three-dimensional interpretation of two-dimensional images, IEEE Trans. Pattern Anal. Mach. Intelligence 5 (2) (1983), 140-150.

94

SCHAFFER

AND

VAN

WYK

L. L. DINES, On convexity, Amer. Math. Monthly 45 (1938). 199-209. 5. R. L. GRAHAM, An efficient algorithm for determining the convex hull of a finite planar set, Inform. Process. Lett. 1 (1972), 132-133. 6. R. L. GRAHAM AND F. FRANCESYAO, Finding the convex hull of a simple polygon. J. Algorithms 4 (1983), 324-331. 7. T. KANADE, Geometrical aspects of interpreting images as a three-dimensional scene,

4.

Proc. IEEE 71 (7) (1983), 789-802. 8. V. L. KLEE, JR., The support property Math. J. 15 (1948), 767-712.

of a convex set in a linear normed space, Duke

9. D. T. LEE, On finding the convex hull of a simple polygon, Internar. Sci. 12 (1983),

J. Comput.

Inform.

87-98.

10. D. MCCALLUM AND D. AVIS, A linear algorithm for finding the convex hull of a simple polygon, Inform. Process. Left. 9 (1979), 201-206. 11. A. C. C. YAO, A lower bound to finding convex hulls, J. Assoc. Comput. Mach. 28 (1981) 780-787.