Epsilon Geometry BuildingRobustAlgorithms Computations-P208-Salesin
Epsilon Geometry BuildingRobustAlgorithms Computations-P208-Salesin
208
that x > y can be made true by perturbing x and y by More precisely, the procedure P(X) should return a par-
at most .5. tition of the real line into three sets F, U, T, such that
Throughout this paper we will assume that 1111is a the predicate E-P(X) is false for 6 E F, true for E E T,
Minkowski metric. Minkowski metrics include all L, and unknown for E E U. We call such a procedure an
distance functions, in particular the Euclidean (Lz) and epsilon-box for P.
Manhattan (Ll) metrics. Note that the composite met- Given that E-P(X) is a monotonic boolean function
ric (1) is Minkowski if the metrics 11[Ii are Minkowski. of E, for any fixed X, we can assume that F, U, and
It follows immediately from the definition of an T are intervals of the real line (empty, bounded, or un-
c-predicate that bounded), with F before U before T. Since the floating-
point numbers are a discrete set, such a partition can be
E-P(X) * &‘-P(X) for all 6’ 2 E (2) represented by a pair of numbers e = (e.lo, e.hi), such
that a-P(X) is false for e < e.lo, true for E > e.hi, and
and unknown for e.lo 5 E < e.hi. To cover all possible tri-
Ilot(&-P(X)) =R not(&-P(X)) for all 8 < e (3) partitions of 3, we must let e.lo and e-hi assume also
the special values +oo or -oo.
We can extend our definition of c-predicate to negative We will call such pairs intervals ofuncetiaintyor sim-
values of E, in such a way that properties (2) and (3) ply intervals. Note that this name is slightly misleading,
remain true for all E. If E > 0, we define (+)-P(X) as because the pairs cannot be viewed as ordinary intervals
a shorthand for “P(X’) is trzle for all X’ E 0 S&J ihat of the real line. The difference is that two degenerate
11x,X’ll 5 E.” Intuitively, an object X that is (-6)-P pairs (2, x) and (Y, Y) with z # y are quite distinct out-
is “extremely P,” whereas an X that is only E-P is just comes, even though they define the same (empty) set U
“nearly P.” This definition can also be expressed by of “uncertain” E-values.
the identity Informally, the pair e returned by P(X) tells us that
X is at least e.lo and at most e.hi away from satisfying
(-&)-P(X) * not(s-(not P(X))) the predicate P. In particular, if e.lo > 0, then P(X)
is definitely false; if e.hi 5 0, then P(X) is definitely
The following properties of epsilon-predicates follow true; and if e.lo 5 0 < e.hi, the procedure was unable
readily from the definitions and the triangle inequality to decide whether P(X) is true of false because of com-
for distances: putation errors.
As we shall see, this approach allows us to build ro-
Lemma 1 For any predicates, P and Q, and any E 2 0,
bust geometric algorithms out of arbitrarily inaccurate
E-(P v Q)(X) (j E-P(X) v E-Q(X) primitives. In general, such an algorithm will produce
results that are correct only in an approximate sense.
E-(P A Q)(X) =$ E-P(X) A E-Q(X)
However, the algorithm will always be able to combine
Note that in the case of A the implication only works the uncertainty intervals returned by the primitives into
in one direction, because even if it is possible to satisfy a “warranty” for the result: that is, an interval of uncer-
P(X) and Q(X) separately with c-perturbations to X, tainty that states how far the result that was returned
it may not always be possible to satisfy both constraints may be from the exact one.
simultaneously. In principle, we do not make any assumptions on
the size of the uncertainty intervals U returned by an
Lemma 2 For any ~,6 1 0, and any predicates epsilon-box. We consider an epsilon-box to be correct
P, Q, R, if P(X) implies E-Q(X), and Q(X) implies as long as E-P(X) is false for all E E F, and true for all
&R(X), then P(X) implies (E + 6)-R(X). E E T. An epsilon-box box is always allowed to say “I
don’t know” for an arbitrarily large range U or E values.
In particular, the trivial epsilon-box that always returns
1.2 Implementing Epsilon-Predicates
T = F = 4, U = SRis a correct implementation of any
When geometric tests such as collinearity or convex- predicate P.
ity are implemented using floating point arithmetic in In practice, of course, an epsilon-box should keep its
the straightforward way, their outcome becomes subject uncertainty trange U reasonably small in order to be
to errors. In order to quantify those errors and allow useful. Typically, a primitive box P(X) will compute
geometric algorithms to cope with them, we propose the distance from X to the truth-set of P using floating
to implement each geometric test P(X) as a procedure point arithmetic, and estimate the uncertainty of the
P(X) that, instead of simply returning true or false, result according to standard numerical analysis tech-
returns an estimate of how far X is from satisfying P. niques. For most primitives, this epsilon-box will be
209
only a few times slower than the naive implementation that E-R(X) is false for & < min{a.lo,b.lo}, and true
of P(X). We will come back to this topic in section 2. for E 1 max {a.hi, b.hi). Therefore, the procedure R(X)
can safely return the pair T = a LI b, which we call the
1.3 Combining Epsilon-Boxes join of a and b.
As a final example, suppose again that we have com-
The following operations on uncertainty intervals turn puted two possible results a and b for R(X), but now
out to be useful for combining primitive epsilon-boxes we know that both intervals are correct. This tells us
into more complex algorithms. Given two uncertainty that E-R(X) is false for E < max{a.Zo, b.lo}, and true
intervals a, b, we define for E 1 min {ahi, b.hi}. Therefore, R(X) can return the
pair r = a 176, which we call the meet of a and b.
min{a,b} = ( min{a.lo,b.lo}, min{a.hi,b.hi))
Note that if both a and bare correct outcomes, the re-
max {a, b} = (max {ale, b.Zo}, max {a.hi,b.hi}) sult r = an b is bound to satisfy r-lo 5 r.hi. IIowever, in
sub = (min{a.lo,b.Zo}, max{a.hi,b.hi}) more complicated expressions this need not be the case.
anb = (max {a.lo, b.lo}, min {ahi, b.hi}) For those situations, it is useful to define the “impossi-
ble” interval 0 = (+oo, -00) and define by convention
For example, suppose we managed to prove that the a fl b = 0 whenever a and b are incompatible outcomes,
predicate e-R(X) is equivalent to e-P(X) V E-&(X), for that is, whenever a.10 > b.hi or b.lo > a.hi. Note that
all X and all E. Then the predicate R(X) can be imple- 0lla=a~0=0,andaU0=0Ua=a,foranya.
mented as the procedure R(X) that evaluates the inter-
vals a = P(X) and b = Q(X), and returns the interval
min{a, b}. Note that this interval is generally noi the 2 Some Basic Predicates
union of the intervals a and b.
This rule is easy to understand with the help of Now let’s consider in more detail the implementation
figure 2, which shows the “graphs” of the predicates of basic geometric predicates of two-dimensional geom-
E-W) 9 dxw, and E-R(X), for a particular X, as a etry. Unless said otherwise, we will measure distances
function of &. The “fuzzy” portion of each graph rep- between points in the plane with the familiar Euclidean
resents the uncertainty interval returned by the corre- (~52) metric, tlp,qll = &.z - 4.z12 + (I-V - q412.
sponding epsilon-box. However, many of the results that follow can be adapted
to any other L, metric. In fact, some of the algorithms
q.lo ehi described below may be easier to code (but probably
harder to prove) if we defined 1111to be the L, or L1
metric.
2.1 Coincidence
Let’s consider first the Coincident predicate, which
merely tests whether two points of the plane are coinci-
T-Qcle
dent or distinct. According to the general definition, the
*C:
Figure 2. derived predicate E-Coincident(p, q) is true if and only
if& 2 alIp, qll. Therefore, the procedure Coincident
Similary, if we know that the predicate &-R(X) is that implements this predicate should compute the dis-
equivalent to &-P(X) A E-Q(X), for all X and all &, then tance IIp,qII, and return a pair (e.lo,e.hi) such that
the procedure R(X) should return max {P(X), Q(X)}. e.lo 5 fllp,qll 5 e.hi. This interval tells us that it
Note that in most machines these operations can be is possible to make p and q coincident if we displace
performed without any rounding errors. Note also that both points by e.hi in suitable directions, and it is not
the uncertainty c.hi - c.10 of the result c is no greater possible to make p and q coincident if we displace them
than the uncertainty in the inputs a and b. by less than e.lo.
Another situation that often arises in algorithms is Note that depending on the application, it may
the following. Suppose we computed two possible re- not be necessary to compute the Euclidean distance
sults a and b for the epsilon-box R(X), by two differ- Ilp,q(l with high accuracy. For example, we can use
ent algorithms, and we know that the first algorithm the property that IIP, !?II, I III? !7II 5 fillP7 qll,,
is correct when some condition P(X) is true, and the where IIP,4, = max(1p.z - q.zl, 1p.y - q.yl}. The
second one is correct when P(X) is false. If we cannot Coincident box may then compute D = IIp,qII,, and
decide whether P(X) is true or false, we can still tell return the interval (e.lo, e.hi) = (D/2, D/d). This is a
210
very coarse approximation, with a relative uncertainty the Coincident procedure can return the uncertainty
of the result is almost 50%; however, it is somewhat interval
faster to compute than the square root formula, and it
may still be accurate enough for many applications. e = (e.lo, e.hi) = (d*(l - 3u)/2, d*(l + 3u)/2) (7)
fi(l+xi)/fi(l+J;)
i=l j=l
211
points. See figure 4. Geometrically, the determinant D is twice the area of
the triangle pqr, with a plus or minus sign depending
on the orientation of the three points. In the Euclidean
metric, the smallest perturbation that makes the three
points collinear is one that moves them onto the perpen-
dicular bisector of the shortest altitude of the triangle.
See figure 6.
Figure 4. E-Collinearity.
In exact geometry, a triangle T = (p, q, r) whose ver-
tices are not collinear can be further classified by its ori-
entation, either positive (counterclockwise) or negative
(clockwise). The orientation is the sign of the determi-
nant
Figure 6.
1 Pax P*Y
D(P, q, r) = 1 q-2 Q*Y (8) Since the area of a triangle is given by one half its base
1 r.2 r.y times its height, the necessary perturbation E is iIDJ/b,
We define the predicates Pos(p, q, r) and Neg(p, q, r) as where b is the length of the longest side.
meaning D(p, q, r) > 0 and D(p, q, r) 5 0, respectively. We can use this result to implement a Pos box that
Note that PM(T) is not the same thing as not Neg(T); uses only single-precision floating-point computations,
in fact Pm(T) A Neg(T) s Collinear(T). (This conven- as follows. First, we need to estimate the rounding er-
tion is a bit confusing, but it seems to simplify many of rors incurred in the computation of IDl/b. From equa-
the proofs and algorithms we will see later on.) tion (8) we get
By definition, then, E-Pos(p, q, r) means that is possi-
D= (q.x-p.z)(r.y-p.y)-(q.y-p.y)(r.x-p.x) (9)
ble to make D(p, q, r) 1 0 by displacing the three points
by at most E in suitable directions. In graphical terms, If we compute this formula using floating-point opera-
E-Pos(p, q, r) means that the closed e-disk centered at r tions, we obtain an approximate result D’ satisfying
either intersects the c-butterfly ofp and Q, or lies fully to
Dk = ((4.x - p.x)(r.y - p.y)(l + 3X1)
the left of it (as looking from p towards q). See figure 5.
-(q.y - p.y)(r.+ - p.x)(l + W))(l + X3)
b= max{IIP,41,Ilq,41,Ilv4lI
where II II is the familiar square root formula (4). As we
discussed in section 2.2, if we assume that the square
root operation is accurate to the machine precision, then
Figure 5. E-Orientation.
the the computed value b’ satisfies b’ = b(1 + 3Xe).
From linear algebra we know that the the determinant Therefore, the computed value h* for the triangle’s
D changes sign if we swap any two of the three points, height h = D/b satisfies
and remains unchanged if the three permuted are per- D( 1+ A3) + 3X&4
muted in a cyclic fashion. Thus, h* = (1 + k3)
b(l + 3A7)
E-Pos(p, q, r) G e-Pos(q, r,p) E c-Pos(r,p, q)
=
E e-Neg(q, p, r) G c-iVeg(r, q,p) E c-Neg(p, r, q)
Note again that &-Neg(T) is quite different from In fact, since IDI 2 I<, we can further simplify this to
not a-Pas(T), and, in fact, h* = h + 7AllM/b. Therefore, we conclude that
212
Note that M can be as large as b2, and that uM/b can A similar result holds for /?. Therefore, these computa-
easily be greater then h, which means that the rela- tions give us two intervals a and b, which may or may
tive error of h* can be arbitrarily large. Formula (10) not include 0.
says that the absolute error of h’ is small compared to We obtain uncertainty intervals dp and dq for the dis-
the distances between the three points. If this inaccu- tances $l/z,pll and $1jz,qll by calling the Coincident
racy is a problem, one can make the relative error small box. As for ~llz,~lJ, its value is twice the area of
by computing D with extended precision; more specifi- the triangle zpq, divided by the length of pq; that is
cally, with at least 2m + 1 fraction bits, where m is the I%> p,dI/IIp, nil, w here D is the determinant defined
number of fraction bits in single-precision floating-point by equation (8). Therefore the analysis we did for the
numbers. Pos subroutine applies here too (except that b is the
Even though Pos and Neg are not the exact oppo- length of pq, instead of the longest side), and we get the
sites of each other, the asymmetric representation we same uncertainty interval dl = h*f7uM*/b*. (If b’ = 0
use for the outcome of epsilon-boxes allows us to state then we can conclude that b = 0, in which case we let
the following result: if the pair a = (U./O, a.hi) is a valid dl be the pair (O,O).)
outcome for Pas(T), then the pair -a = (-a.hi, -a.lo) We now have to put all this information together and
is a valid outcome of Neg(p, Q,r). Therefore the proce- deduce from it an uncertainty interval e for the distance
dures Pos and Neg can share most of their code, and if from z to the segment pg. The algorithm is relatively
we evaluate Pas(T) we do not need to evaluate Neg(T). straightforward:
1. et0
2.4 Betweenness 2. if a.lo_<OAb.hi_>O then e+-eUd, ii
We say that a point z is between two other points z and Q 3. if b.lo<OAa.hikO then eteUd, ii
if z lies on the closed segment pg. We denote this fact by 4. if a.hi>Ohb.hi>O then e+eUd, ii
Between(z,pq). It is easy to see that E-Between(z,pq) 5. return e
if and only if the distance from z to the segment pq is Step 1 initializes e to the dummy interval 0 that is a
at most 2s; or, equivalently, if and only if the c-disk neutral element of U. Step 2 checks whether the projec-
centered at z intersects the E-stroke of p and q. See tion .z’ could lie before p, in which case the uncertainty
figure 7. interval e is set to the range of possible values of ~&~,pll.
Step 3 does the same thing for q. Finally, step 5 checks
whether z’ could lie strictly between p and q, in which
case it sets to e the range of )IIz, /Il. Note that if the
algorithm cannot decide between any two cases, it will
simply merge the corresponding uncertainty intervals.
213
that %is inside T if and only if the triangles ztctr , ztrtz, section 1.3: evaluate Between(z,p, q) for all edges p, q
and %-&toare all positively oriented (or flat). Moreover, of T, and return the min of the resulting pairs. In fact,
if %is inside T, any perturbation that puts I outside the it is easy to check that this algorithm works even if T
triangle must reverse the orientation of one (or more) of is replaced by an arbitrary polygon.
these triangles. We conclude that How does the Boundary predicate help us? The an-
swer is given by the foiowing trivial properties:
Lemma 3 If a point % is inside a positively oriented
triangle T = (to, tl, tz), then for any e (positive or neg- Lemma 4 If a point z is outside a triangle T, then for
ative), all E 2 0
214
As we observed before, the interval P is still not the As figure 8 shows, a point can be well inside the polygon
answer we want, since r was obtained by considering P, even if it is possible to reverse the orientation of some
independent perturbations to each of the three edges, triangle zpipi+r by an arbitrarily small perturbation to
and those perturbations may not be simultaneously re- those three points. Therefore, for InConvex must use a
alizable. The only useful information contained in r is different approach, as follows. When z is inside P, we
its lower endpoint r.10, provided it is less than zero: if will estimate the degree of “insideness” from the output
--E < r.lo < 0, that is, if we cannot change the orien- of the Boundary box alone, using lemma 5. When z is
tation of one of any of the three triangles with any E- outside P, we will estimate its degree of “outsideness”
perturbation, then we cannot move z out of T with any with several calls to InTriangle, using the following
&-perturbation, which means z is (-&)-inside T; and obvious property:
conversely. On the other hand, if r.lo 2 0, we know
only that z is outside, but we can’t tell by how much. Lemma 6 LetTr,Tz,..., T, be a set of triangles whose
In other words, at step 13 the uncertainty interval of union is the set P. If a point z is outside P, then for
Pos is (r.10 _ 00) U(0 _ infty). all E 1 0,
In order to reduce this uncertainty to a useful level,
we evaluate b = Boundary(z, T), the minimum pertur-
c-Inside(t, P) H 6 E-lnside(z, Ti)
bation needed to put z on the boundary of t. The re-
i=l
sulting interval b is always non-negative; moreover, by
lemmas 4 and 5, the result we want is either -b or +b, Note that lemma 6 cannot be extended to E < 0, be-
depending on whether t is inside or outside T. So, the cause J can be near an edge of some triangle Ti and
result we want is the intersection of those two inter- still be arbitrarily far from the boundary of P. Nev-
vals with (r.lo _ oo) Ll (0 _ infty), which simplifies to ertheless, lemma 6 allows us to write an epsilon-box
(-bn(r.lo _ co)) LI b, as returned in step 14. InPolygon(z, P, Tl, . . . , Tm) that implements the Inside
Note that the width of the interval returned by this test for a planar figure P, given a collection of triangles
algorithm is at most twice the size of the widest interval Tl,T2 ,..., Tm whose union is P:
returned by the Pos and Between boxes.
As usual, there is here a tradeoff between speed and 1. r c rain {InTriangle(z, Ti) : 15 i 5 m}
accuracy. One could reduce the width of the uncertainty 2. if r.lo 2 0 then return r f i
interval returned by InTriangle(z, T) by performing 3. r.10 c -00
more elaborate tests, by using more accurate primitives, 4. b c Boundary(z, P)
by combining their results in a more sophisticated fash- 6. return (r fl b) LI (r fl -b)
ion, or by implementing the InTriangle procedure as a
primitive, as we did with Poe. Step 1 computes the perturbation r necessary to put
z inside one of the triangles Ti::. If r.lo 2 0, it means
3.2 Point Inclusion in a Convex Polygon z is outside P, and by lemma 6 we can return r itself
as the outcome. If r.lo < 0, lemma 6 tells us nothing:
Let’s now consider the more general predicate that the uncertainty interval for Inside(z,P) is not r but
tests whether a point z lies inside a convex polygon the whole interval (-oo,r.hi). In order to reduce this
P=(poJQ,... ,pn-r). One might think that the imple- uncertainty, we look at the perturbation b needed to put
mentation InConvex of this predicate is a trivial general- z on the boundary of P (step 4). According to lemmas 4
ization of InTriangle, but that is not the case. While and 5, the InPolygon box can safely return r 17b is z
lemmas 4 and 5 generalize nicely to arbitrary convex is outside P, and r tl -b if z is inside P; therefore, it
polygons, lemma 3 does not. , , can always return return the join of these two intervals
(step 5).
Given this algorithm, the InConvex box that im-
plements the Inside test for convex polygons is triv-
ial: it suffices to note that a convex polygon P =
(Pod%... ,p,-1) is the union of the triangles Popipi+l
for 1 5 i 2 n - 2.
Note that, as in the the case of InTriangle, the width
of the uncertainty interval returned by InPolygon or
InConvex is at most twice that of the widest interval
returned by any of the primitive epsilon-boxes called by
Figure 8. them.
215
Some applications of the InConvex box may not re- z is inside P but not inside Q. Consider the rays from
quire all the information that it returns. In such cases x to P(t) and from z to Q(t). As t goes once -around
the algorithm can often be made simpler and faster, at the unit circle, the first ray makes a non-zero number of
the cost of returning a much wider uncertainty interval. full turns, while the second makes zero full turns. Since
For example, if we only want to know whether we are the curves are continuous, there must exist a value oft
inside or outside P, but we don’t care by how much, we for which the angle between the two rays is a. At that
can omit steps 4 and 5. In that case, when z is inside P moment, 2 is on the segment connecting P(t) and Q(t),
or close enough to it the algorithm will return intervals whose length is at most E, by hypothesis. q
of the form (--00, E). This result is not as trivial as it may sound. For
instance, it is not enough to merely require that every
point of the curve P be within E of Q and vice versa.
4 Approximate Convexity
The InConvex test of the previous section assumes the 4.2 Polygons
polygon is convex in the ordinary sense. By itself, such The next lemma states an elementary property of
a test isn’t very useful, since in many applications we Minkowski metrics is useful when applying lemma 7 to
cannot always ensure that the polygons are strictly con- polygons:
vex, because they can be the result of previous ap-
proximate computations, and the rounding errors in- Lemma 8 Let 11,II be any Minkowski metric. Then for
curred may have introduced slightly concave corners, any four points p, q, p’, q’ such that IIp,p’ll < E and
self-intersections, and other similar defects. Worse still, IIq, q’jl < e, and for any cx E [0 _ 11, we have
if we are allowed to use only approximate primitives
like the ones we described, we will not even be able to ll(1 - @Y)P+ %I, (1 - (Y)p’ + q’ll I E
clrecAwhether a given polygon is convex. Therefore, we
must learn how to handle polygons that are only “ap- The next result is a trivial corollary of lemmas 7
proximately convex.” In order to do this, we must first and 8:
define more carefully the meaning of “inside,,, and prove
l$rny; “, If the polygons P = (~0, pl, . . . ,p,,-1) and
a few results about closed curves in general. = 0, l,.**,!In-1 ) are such that lIpi, gill 5 2~ for
all i, then any point inside P is e-inside Q (and vice
4.1 Closed Curves versa).
We define a closed curve to be a continuous function
from the unit circle Sr into the plane, and we consider 4.3 Inclusion in an E-Convex Polygon
two curves to be the same if they differ only by a simple Now let’s try to extend the InConvex algorithm to
reparametrization, that is, by a homeomorphism of Sl polygons that are not necessarily convex, but merely
to itself. We say that a point z is inside such a curve C &-convex. According to the general definition, a poly-
if the curve passes through Z, or if its winding number gon P is &-convex: if there exists a convex polygon P’
around z is non-zero [4]. Note that the curve need not that is at most E away from P; or, equivalently, if we
be simple. We denote this fact by Inside(z) C). can perturb the vertices of P by at most E in such a
We define the distance between two curves C,C’ way that the result is a convex polygon. We will use
as the smallest value of max {]]C((~(t)),C’(t)]l : t E Si}, the following result:
when cp ranges over all reparametrizations of C. In
spite of this complicated metric, the meaning of Lemma 10 Let P = (po,p1,. . . ,p,,l) be an e-convex
e-Inside(r) C) is quite simple: if E 1 0, this predicate polygon, with E > 0, and z a point of the plane. Let P”
means that z is either inside C or at most 21~1away be the union of the triangles popipi+l for 1 5 i 2 n - 2.
from C; and if E < 0, it means that z is inside C but at Then
least ]&I away from C.
Inside(z) P) =S Inside(z, P’) + &-lnside(z, P)
Lemma 7 Let P and Q be two closed curves with the
property that IIP(t), Q(t)/1 5 E for allt on the unit circle. Proof: Let’s prove first that Inside(r,P) =+
Then any point that is inside P is (E/2)-inside Q, and Inside(z,P*). If the point z is inside the polygon P,
vice versa. then any ray starting from z should meet at least one
edge pipi+ of P for 1 5 i 5 n- 2. (Assuming each edge
Proof: Let x be a point inside P. If x is inside Q or x includes its endpoints.) In particular, this should hap-
is on the curve P, then we are done. Let’s assume that pen for the ray out of z that is directed away from po.
216
This ray proves that z is inside the triangle popipi+l, Acknowledgements
and hence inside P”.
The ideas for this paper grew out of discussions
Now let’s prove that Inside(z, P’) + .e-1nside(r, P).
with Bernard Chazelle, Herbert Edelsbrunner, Michel
By definition there exists a convex polygon P’ such that Gangnet, Ricky Pollack, Franc0 Preparata, and Micha
]]pi,dl] 5 E for all i. By corollary 9, every point inside
Sharir. Victor Milenkovic showed us the proper way
P’ is (a/2)-inside P. By the same argument, any point
to compute the orientation primitive and estimate its
of triangle popipi+l is (E/2)-inside the corresponding tri-
rounding error. We would like to thank the DEC Paris
angle pbp:pi+,; therefore, by lemma 6, any point in P*
Research Lab and the DEC Systems Research Center,
is (s/2)-inside P’. By the triangle inequality (lemma 2),
which supported much of this work.
then, any point of P’ is E-inside P. 0
This lemma gives us an algorithm InEpsConvex(z, P, E)
that tests whether a point z is &Inside a polygon P, References
assuming that P is &-convex. The algorithm is a slight
modification of the InConvex box that we gave in sec- [1] Herbert Edelsbrunner and Ernst Peter Miicke, “A
tion 3.2: technique to cope with degenerate cases in geomet-
ric algorithms.” Proc. 4th Annual ACM Symp. on
1. r e min{InTriangle(z,pcpipi+l) : 1 _< i 5 ta - 2) Computational Geometry (1988), 118-133.
2. r.hi+r.hi+s
[2] Daniel H. Greene and F. Frances Yao, “Finite-
3. if r.10 2 0 then return r ii
resolution computational geometry.” Proc. 27th
4. r.lot--00
IEEE Symp. on the Foundations of Computer Sci-
5. b + Boundary(z,P)
ence (1986), 143-152.
6. return (r ll b) U (r ll -b)
[3] Christoph M. Hoffman, John E. Hopcroft, and
After step 1 we know that I is b-inside some of the Michael S. Karasick, “Towards implementing ro-
triangles papipi+l, for 6 2 r.hi, and not b-inside any of bust geometric computations.” Proc. 4th Annual
them for 6 < r.lo. Step 2 adjusts r.hi to account for the ACM Symp. on Computational Geometry (1988),
fact that the union of those triangles may include points 106-l 17.
that are up to 2~ away from P. This step is justified
by the triangle inequality (lemma 2). The rest of the [4] Leo Guibas, Lyle Ramshaw, and Jorge Stolfi, “A
kinetic framework for computational geometry.”
algorithm is shown correct by the same arguments used
Proc. 24th IEEE Symp. on Foundations of Com-
for InPolygon in section 3.2.
puter Science (October 1983), 100-111.
[5] Donald E. Knuth, “The art of computer program-
5 Conclusions ming, vol. 2: Seminumerical algorithms” (second
edition), section 4.2.2. Addison-Wesley (1981).
The Epsilon Geometry framework we described in this
paper allows us to build robust algorithms using im- [S] Victor J. Milenkovic, “Verifiable implementations
precise computations. Because our framework allows us of geometric algorithms using finite precision arith-
to use ordinary fixed- or floating-point arithmetic and metic.” International Workshop on Geometric Rea-
substitute simpler approximations for hard-to-compute soning (Oxford, England, July 1986).
formulas, we believe it has great practical potential. [7] S. P. Mudur and P. A. Koparkar, ‘qnterval methods
An important feature of the Epsilon Geometry ap- for processing geometric objects.” IEEE Computer
proach is its flexibility, in that it gives the designer of a Graphics and Applications (February 1984), 7-17.
geometric algorithms great freedom to choose between
accuracy, efficiency and simplicity. Our approach allows [S] Thomas Ottmann, Gerald Thiemt, and Christian
us to combine primitive epsilon-boxes into more com- Ullrich, “Numerical stability of geometric algo-
plex algorithms, independently of the number represen- rithms.” Proc. 3rd Annual ACM Symp. on Com-
tation and machine precision used inside each primitive putational Geometry (1987), 119-125.
box.
[9] Chee-Keng Yap, “A geometric consistency theo-
We have barely started to explore the application of rem for a symbolic perturbation scheme.” Proc. 4th
this framework to classical computer geometry prob- Annual ACM Symp. on Computational Geometry
lems. If the examples we give in this paper are too (1988), 134-142.
elementary, it is only because we haven’t had time yet
to consider more complex ones.
217