Voronoi diagram of a circle set from Voronoi diagram of a point set: I. Topology

36
1 Voronoi diagram of a circle set from Voronoi diagram of a point set: II. Geometry Deok-Soo Kim*, Donguk Kim* and Kokichi Sugihara** * Department of Industrial Engineering, Hanyang University, Seoul, South Korea ** Department of Mathematical Engineering and Information Physics, University of Tokyo, Tokyo, Japan Mailing Address Deok-Soo Kim, Associate Professor Department of Industrial Engineering Hanyang University 17 Haengdang-Dong, Sungdong-Ku Seoul, 133-791, South Korea Phone Number +82-2-2290-0472 Fax Number +82-2-2292-0472 E-mail Address [email protected]

Transcript of Voronoi diagram of a circle set from Voronoi diagram of a point set: I. Topology

1

Voronoi diagram of a circle set from Voronoi diagram of a point set:

II. Geometry

Deok-Soo Kim*, Donguk Kim* and Kokichi Sugihara**

* Department of Industrial Engineering, Hanyang University, Seoul, South Korea ** Department of Mathematical Engineering and Information Physics, University

of Tokyo, Tokyo, Japan

Mailing Address Deok-Soo Kim, Associate Professor

Department of Industrial Engineering Hanyang University

17 Haengdang-Dong, Sungdong-Ku Seoul, 133-791, South Korea

Phone Number +82-2-2290-0472

Fax Number +82-2-2292-0472

E-mail Address [email protected]

2

ABSTRACT Presented in this paper are algorithms to compute the positions of vertices and equations

of edges of the Voronoi diagram of a circle set on a plane, where the radii of the circles are not necessarily equal and the circles are not necessarily disjoint. The algorithms correctly and efficiently work in conjunction with the first paper of the series dealing with the construction of the correct topology of the Voronoi diagram of a circle set from the topology of the Voronoi diagram of a point set, where the points are centers of the circles.

Given three circle generators, the position of the Voronoi vertex is computed by treating the plane as a complex plane, Z-plane, and transforming it into another complex plane, W-plane, via a linear fractional transformation. Then, the problem is formulated as a simple point location problem in regions defined by two lines and two circles in the W-plane. After the correct topology is constructed with the geometry of the vertices, the equations of edge are computed in a rational quadratic Bézier curve from.

Key Words: circle set Voronoi diagram, Apollonius’ 10th problem, linear factional transformation, rational quadratic Bézier curve, point location problem, Voronoi vertex, Voronoi edge

3

INTRODUCTION

Suppose that a circle set is given in a two dimensional Euclidean space, where the radii of the circles are not necessarily equal and where the circles are possibly intersecting one another. Given this circle set, we want to compute the Voronoi diagram of these circles.

There are a few researches on this or related problems (Drysdale, 1979; Drysdale and Lee, 1978; Hamann and Tsai, 1996; Lee and Drysdale, 1981; Okabe et al., 1992; Sharir, 1985; Sugihara, 1993). They are reviewed in the first paper of this series (Kim et al., 2000). In that paper, we proposed an algorithm quite different from the others. The main idea of the proposed algorithm is as follows. First, we construct a point set Voronoi diagram for the set of the centers of the circles as a preprocessing. Second, we use the topological information of this point set Voronoi diagram as a seed and modify it to get the correct topology of the Voronoi diagram of circle set via a series of edge-flipping operations which guarantees termination with the correct result. Third, we obtain the correct geometry of the Voronoi diagram using the topology information and the geometry of the circles. The first step obviously takes O(nlogn) and it was shown that the second part takes O(n2) in the worst case, where n is the number of generators. The third step is the main issue discussed in this paper.

The advantages of this approach are many: first, it is easier to find a robust and fast algorithm and running code for a point set Voronoi diagram. Second, our algorithm is as robust as the point set Voronoi diagram algorithm since step 2 in our algorithm just flips the existing edges of the point set Voronoi diagram. Since the proposed algorithm computes a correct topology of the target Voronoi diagram based on the topology of a robust point set Voronoi diagram, it is as stable as a point set Voronoi diagram algorithm. It turns out that the worst-case time complexity of the proposed algorithm is O(n2). However, it is observed from the experiments that the asymptotic running time shows a strong linear behavior. Note that the speed is even comparable to the speed of the ordinary point set Voronoi diagram algorithm. It is because the worst-case scenario can rarely occur in practice even though it is theoretically possible to make. In addition, the algorithm as well as the code is quite simple.

There are two ingredients in the geometry part of the Voronoi diagram of a circle set: the positions of the Voronoi vertices and the equations of the Voronoi edges. The position value of a Voronoi vertex is computed when three generator circles are given, and this information is used to verify whether a given Voronoi edge is valid or not in the final topology of the Voronoi diagram of a circle set. Hence, the computation of the position of a Voronoi vertex is closely related to the topology part of the proposed approach, and it is necessary to compute the position of a Voronoi vertex in the middle of the edge flipping process. However, the equations of the Voronoi edges can be computed completely independent of all the other operations and

4

can be performed after the other operations are over so that they can be handled like a post-processing.

Computing the position of a Voronoi vertex of a circle set Voronoi diagram is exactly the problem of computing the center of the circumcircle for a set of three circles, and it turns out to be the well-known Apollonius’ 10th problem (Boyer, 1968; Courant and Robbins, 1996; Dörrie, 1965; Johnson, 1929). It is a usual practice to compute the center of this circumcircle as an intersection between two hyperbolic arcs that are bisectors of pairs of circles. It turns out that this process involves the solution process of a quartic equation that can be solved by either the Ferrari formula or a numerical process (Kim et al., 1998). Since the formula involves square root operations, it is relatively expensive and inevitably contains truncation errors. On the other hand, the cost of symbolic generation for the equation of the center of the circumcircle can be quite high. For example, we generated the equation symbolically using Mathematica, where the problem is formulated as an intersection between two hyperbolic arcs, and it took approximately 73,000 lines of code and 2.99MB in ASCII format.

The problem was first considered by Apollonius around 300 B.C., and has been known as the Apollonius’ 10th problem. Even though the problem is quite complicated in Euclidean space, it turns out that it can be rather easily solved by employing the complex system that has been used only after the 19th century by F. Gauss. The linear fractional transformation (also known as Möbius transformation) in a complex plane is known to map circles to lines and vice versa (Kreyszig, 1993). By using linear fractional transformation, we can transform the problem of calculating the circumcircle into the problem of finding tangent lines of two circles. This method turns out to be much simpler than finding the intersection of two hyperbolic arcs.

The equation of the Voronoi edge of the circle set Voronoi diagram is either a part of a line or a hyperbola (Fortune, 1987; Kim et al., 1995; Lee and Drysdale, 1981). A linear bisector occurs between two circles with identical radii, and a hyperbolic bisector occurs between circles with different radii. Persson and Held represented the edge equations using a parametric curve obtained by solving the intersection equations of the offset elements of generators (Held, 1991; Held et al., 1994; Persson, 1978). In their representation, both lines and hyperbolas are represented in different forms. On the other hand, Kim used a rational quadratic Bézier curve to represent the edges (Kim et al., 1995). In this representation, any type of bisectors, for example, a line, a parabola, a hyperbola, or an ellipse, can be represented in a unified form, and hence simplifies applications, such as offsetting (Kim, 1998), involving manipulations of edge geometries.

This paper is organized as follows. The next section provides the definitions of some terminologies and assumptions necessary to present the algorithm. Then, we explain how to compute circumcircle(s) at the vertices of the desired circle set Voronoi diagram. In the

5

following section, the method for calculating the edge equation using a rational quadratic Bézier curve form is presented. Then, we present implementations and experimental results.

PRELIMINARIES

Provided here are a few notational conveniences for the description of the algorithm. { }nii ,...,2,1| == pP denotes the set of the center points ip of circles ic , and { }nii ,...,2,1| == cC denotes the set of circles ( )iii r,pc = where ir is the radius of ic .

VD(P) and VD(C) represent the Voronoi diagrams for point set P and circle set C, respectively. For the convenience of presentation, the notions of edge and vertex will be used in this paper to

mean a Voronoi edge and a Voronoi vertex unless otherwise stated. For each ei, ei′ means the edge obtained by flipping ei. Let CCi be a circumcircle about three generator circles corresponding to a Voronoi vertex vi.

A few assumptions on the input data are made for the convenience of discussions, and its generalization for degenerate cases can be made without much difficulty. The first assumption is called the non-degenerate point set assumption which means that the degree of

any vertex of VD(P) is three. The second assumption is called the non-degenerate circle set assumption which means that the degree of any vertex of VD(C) is also three. Circles are not allowed to reside interior to the other circles, and this is called the non-inclusion assumption. In addition, the distance metric employed in this paper is the ordinary Euclidean L2-metric. We

also assume that VD(P) as well as VD(C) are maintained in a data structure such as a winged-edge or a half-edge data structure. For the details of these data structures, the readers are recommended to refer to (Mäntylä, 1988; Preparate and Shamos, 1985).

VERTEX GEOMETRY

Suppose three generator circles are given. Then, there are at most eight circles simultaneously tangential to the generators, as shown in Fig. 1. In the figure, the shaded circles are the generators and the white ones are the tangent circles. Fig. 1(a), (b), (c), and (d) illustrate the cases of one circumcircle, three circles where one generator is internal to each circle while two generators are external, three circles where two generators are internal while one generator is external, and the case where all three generators are internal to a circle, respectively. Among these tangent circles, we want to find the first case: a circumcircle for three generator circles.

6

<Insert Fig.1.>

However, there may be either zero, one or two circumcircles for a given generator set of three circles, as shown in Fig. 2.

<Insert Fig.2.> Therefore, the question is how to find, easily and fast, which case the configuration of a given generator set is, and how to find the circumcircles if they exist.

Linear fractional transformation Let a plane, where the generators are lying on, be complex; that is, a point (x, y) in the

Euclidean plane is treated as a complex number z = x + iy. Also, let generator circles with a center (xi, yi) and a radius 0≥ir be represented as ( )iii rz ,=c , i = 1, 2, and 3, as shown in Fig. 3. Assuming 13 rr ≤ , 23 rr ≤ , the subtraction of r3 from the radii of all the generators (i.e., ( )3,~ rrz iii −=c , i = 1, 2, and 3) transforms the given generators 1c and 2c to shrunk circles 1

~c and 2~c , and reduces 3c to 3

~c which is in fact degenerated to a point 3z . Then, if we can find a circle c~ passing through 33

~c≡z and tangent to both 1~c and 2

~c , we can easily find a circle c , which is simultaneously tangent to 1c , 2c and 3c , by simply

subtracting r3 from the radius of c~ . Even though we can locate four tangent circles altogether for three generator circles in general, let us consider the case of a circumcircle, as shown in the following figure, for the time being.

<Insert Fig.3.>

Suppose that a function W = W(z) = u(x, y) + iv(x, y) be analytic. Then, the mapping

defined by W(z) is conformal, except at critical points where the derivative W′(z) is zero (Kreyszig, 1993). A conformal mapping is known to preserve angles between any oriented curves both in magnitudes and in orientations. Among various conformal mappings, consider the linear fractional transformation (also known as Möbius transformation) defined as

dczbazzW

++

=)( (1)

7

where 0≠− bcad , and a, b, c, and d are either complex or real numbers. Note that W(z) maps

the totality of circles and straight lines in the Z-plane onto the totality of circles and straight lines in the W-plane. Among all possible linear fractional transformations, consider the following transformation.

0

1)(zz

zW−

= (2)

The transformation given by Eq. (2) is known to have the following properties.

Property 1. It transforms lines and circles passing through z0 in the Z-plane to straight lines in the W-plane, and vice versa.

Property 2. It transforms circles and lines not passing through z0 in the Z-plane to circles in the W-plane, and vice versa.

Property 3. It transforms a point at infinity in the Z-plane to the origin of the W-plane, and vice versa.

Therefore, a mapping W(z) = 1 / (z – z3) will transform the 1

~c and 2~c in the Z-plane

to circles W1 and W2 in the W-plane as shown in Fig. 4, if z3 is not on 1~c and/or 2

~c . Then, the desired circle c~ tangent to circles 1

~c and 2~c in the Z-plane will be mapped to a line L

tangent to both circles in the W-plane by the same mapping, because the mapping is conformal

and the desired circle c~ should pass through z3 in the Z-plane.

<Insert Fig.4.>

Note that the point at infinity and points exterior to the circle c~ in the Z-plane are both exterior to the circumcircle c~ . Therefore, the points in the W-plane mapped from the points exterior to c~ in the Z-plane and the origin O of the W-plane must lie on the same side of line L, which is mapped from c~ due to the above properties. In fact, all of the mapped points as well as the origin O should lie on the same side of line L for the circle c~ to be a circumcircle. Due to the conformality of the transformation W(z), c~ , which is tangent to 1

~c and 2

~c in the Z-plane, is mapped into a line tangent to both W1 and W2 in the W-plane. It turns out that this transformation maps the circles ( )3,~ rrz iii −=c into circles Wi, i

= 1 and 2, derived as

8

−−

−=

i

i

i

i

i

ii p

rrp

yyp

xxW 333 ,, (3)

where 23

23

23 )()()( rryyxxp iiii −−−+−= . Similarly to W(z), it can be also shown that

the inverse transformation

31)( zw

wZ += (4)

is also another conformal mapping, and hence, maps lines not passing through the origin in the

W-plane to circles in the Z-plane. Suppose that a line in the W-plane be 01 =++ bvau . Then,

its inverse in the Z-plane is a circle with center

++− 33 2

,2

ybxa and radius

2

22 ba +.

We recommend (Rokne, 1991) for the details of the computation using the mapping.

Hunting a circumcircle from tangent circles Given two circles W1 and W2 in the W-plane, as shown in Fig. 5(a), there could be at

most four distinct lines tangent to both circles simultaneously. Suppose that the black dot is the

origin of the coordinate system in the W-plane. Then, the line L1 maps to 11

~ −c in the Z-plane, Fig. 5(b), by the inverse mapping Z(w) defined in Eq. (4). It can easily be verified by the fact that the circles W1 and W2 as well as the origin O are on the same side with respect to L1. Note that the origin O of the W-plane corresponds to infinity in the Z-plane. Since W1 and W2 are

tangent to L1, and located toward infinity (i.e., toward the origin O), L1 must map to 11

~ −c . Similarly, L2 maps to 1

2~ −c since the circles W1 and W2 are in the opposite side of infinity. Cases

of L3 and L4 are a little bit different. In the case of L3, W1 is on the opposite side, and W2 is on the same side of the line with respect to the origin. Therefore, the inverse mapped circle 1

3~ −c

should contain 1~c inside the circle but should not contain 2

~c . Therefore, L3 maps to 13

~ −c . Likewise, L4 maps to 1

4~ −c . Note that all four inverse mapped circles 1

1~ −c , 1

2~ −c , 1

3~ −c and 1

4~ −c

pass through a point z3 in the Z-plane. In this paper, we call L1 and L2 exterior tangent lines.

<Insert Fig.5.>

9

Therefore, line L which will inversely map to a circumcircle in the Z-plane is either one or both of the exterior tangent lines, L1 or L2, to the circles W1 and W2. Hence, the problem of finding a circle tangent to two given circles on the same side in the Z-plane is again reduced to the problem of finding two exterior tangent lines, such as L1 and L2 in the example, to two circles W1 and W2.

Between L1 and L2, the one which contains both circles, W1 and W2, as well as the origin O in the same side of the line will inversely map to the desired circumcircle(s). Note that zero, one or both exterior tangent lines may be the correct result depending on the configuration of the initially given generator set. Since finding exterior tangent lines of two circles is an easy problem, it will not be elaborated further.

Point location problem in the W-plane Once the exterior tangent lines L1 and L2 are given, verifying whether W1 and W2, as

well as the origin O, are lying on the same side of the lines is not too difficult to do in the computational view point. However, it is not directly obvious in determining which one will back-transform to a circumcircle in the Z-plane via the inverse mapping, or even whether such a circumcircle exists. Therefore, it is necessary to determine if there exists an exterior tangent line which will inverse map to a circumcircle in the Z-plane, and if so, which one (or both) does. It turns out that the situations can be categorized into a few definite cases with systematic structures.

Suppose two circles W1 and W2 are given as shown in Fig. 6(a). Here, the radii of W1 and W2 are different with non-zero values. Let L1 and L2 be the exterior tangent lines to both circles. Let us define “+” operator as follows: +

iL is the half-space, defined by Li, containing W1 as well as W2. Similarly, −

iL means the opposite side of +iL . Note that the boundary of the

half-space, which is the line Li itself, is excluded from both half-spaces. Then, the W-plane can be decomposed into six mutually exclusive regions as follows.

( ) ( )

( ) ( )( ) ( )2121

2121

21

21

21

2121

LLLLLLLL

LLLLLL

LLLL

∩∪∩=

∩∪∩=

∩=

∩=

∩=

∩∪∩=

++

−−

++

−−

+−−+

φ

ε

δ

γ

β

α

10

Let the region α be subdivided into ( )+− ∩= 211 LLα and ( )−+ ∩= 212 LLα . Note that the origin O of the W-plane cannot lie on or interior to the circles W1 and W2 (i.e.,

( )21 WWO ∪⊄ ). Also note that region γ may consist of three subregions in general. Once the

W-plane is decomposed into a set of regions, the problem of computing a circumcircle(s) now further reduces to a so-called point location problem among the regions. Since the geometry for the problem in this case is obvious, the computational aspect is trivial.

Then, the possible cases are categorized as follows (See Fig. 7). Each case describes one in which the origin lies in a corresponding region in Fig. 6(a). A dotted circle represents a circle inscribing given generator circles, and a solid circle represents a circumcircle. Note that the generators, shown as shaded ones in Fig. 7, are shrunk circles in the Z-plane. Black dots are the generator circles with zero radii in the Z-plane. Note that this case, a case with two circles in the W-plane having different non-zero radii, occurs only when the radii of two smaller generator circles in the Z-plane are not identical.

Case α: Suppose 1α∈O . Then, L1 is inverse-mapped to a circle 1

1~ −c in the Z-plane,

illustrated as a dotted curve, inscribing 1~c and 2

~c . Recall that the inverse mapped circle 1

1~ −c should inscribe 1

~c and 2~c , which are the inverse maps of W1 and W2, because L1

places O on the opposite side of W1 and W2. On the other hand, L2 is inverse-mapped to a

circumcircle 12

~ −c tangent to 1~c and 2

~c in the Z-plane, and is illustrated as a solid

curve. Fig. 7(α1) shows this case. Note that two tangent lines in the W-plane intersect each other at δ. This means that two circles, whether they are circumcircles or inscribing circles, also intersect each other at δ-1, shown as a black rectangle, in the Z-plane due to the conformality of the mapping.

Case β: When O lies in the area β, both circles W1 and W2 are on the opposite side of O with respect to both tangent lines L1 and L2. Therefore, both L1 and L2 should be mapped

to inscribing circles, and hence, no circumcircle will result. Fig. 7(β) shows this case. Case γ: When O lies in area γ, both circles W1 and W2 are on the same side of O with

respect to both tangent lines L1 and L2. Hence, both L1 and L2 should be mapped to

circumcircles only, but not to inscribing ones. Case γ1 in Fig. 7 occurs when O lies in the subregion γ1 in Fig. 6, which is located in-between W1 and W2. Case γ2 in Fig. 7 occurs when O lies in the subregions γ2 in Fig. 6.

Case δ: When O lies precisely on δ, the inverse mapping to the Z-plane yields results similar to what is presented in the W-plane. It consists of two circles with positive radii and one circle with zero radius. L1 and L2 map to lines that pass through the degenerate

circle, which is in fact a point. Fig. 7(δ) shows this case. Case ε: When O lies precisely on an either ray ε, which is a ray starting from δ, the line

11

inverse maps to another line in the Z-plane. Then, the origin should be located on the opposite side of the other line with respect to the circles W1 and W2, meaning that there is

an inscribing circle. Hence, Fig. 7(ε) results. Case φ: When O lies precisely on an either line φ, which is also a ray starting from δ, the

line inverse maps to another line in the Z-plane similarly to case ε. Then, the origin should be located on the same side of the other line with respect to the circles W1 and W2. It

means that the line inverse maps to a circumcircle in the Z-plane. Hence, Fig. 7(φ) should result.

Depending on the configuration of the generator circles in the Z-plane, however, slight

changes in the above cases may occur. Suppose two smaller generator circles in the Z-plane, c1

and c3 in this example, have identical radii. Then, W1 degenerates to a point δ, and it makes the region γ to consist of two subregions, not three. What is presented in Fig. 6(b) is such a case. Because W1 degenerates to a point δ, which is the intersection between tangent lines in the W-plane, two tangent circles in the Z-plane inverse-mapped from the tangent lines should intersect at both 1

~c as well as 3~c , which are in fact points. This is due to the fact that the tangent circles

should pass through 3~c while they intersect at 1

~c . Illustrated in Fig. 7(αD1), (βD1), (γD1), (εD1),

and (φD1) are these cases.

Case αD1: Suppose O lies on α1 in Fig. 6(b). L1 is inverse-mapped to an inscribing circle in the Z-plane, illustrated as a dotted curve. On the other hand, L2 is mapped to a desired circumcircle, illustrated as a solid curve. Note that there are two intersections between two tangent circles, as was discussed previously.

Case β D1: Case β D1 is when O lies in region β D1. Since O lies on the opposite side of W2 with respect to both tangent lines, the inverse-mapped circles should inscribe 2

~c . In

addition, two points shrunk from smaller circles should be located on the opposite side of

2~c .

Case γ D1: When O lies in area γ, the circle W2 is on the same side of O with respect to both tangent lines L1 and L2. Hence, both L1 and L2 should be mapped to circumcircles

only, but not to inscribing ones. It turns out that the subdivision of γ into further subregions is not very meaningful in this case.

Case δ D1: Because O corresponds to infinity in the Z-plane, it is not possible that the origin O lies precisely on δ, which is in fact W1. So Case δD1 does not occur.

Case ε D1: When O lies precisely on an either ray ε, the tangent line in the W-plane inverse-maps to another line in the Z-plane. Since the origin is located on the opposite side of the other tangent line with respect to circle W2, there should be an inscribing circle.

12

In this case, the points shrunk from two smaller circles are also located on the opposite side of 2

~c .

Case φ D1: When O lies precisely on an either ray φ, the line inverse-maps to another line in the Z-plane. Since the origin is located on the same side of the other tangent line with respect to circle W2, there should be a circumcircle. The points shrunk from smaller circles are located on the same side of 2

~c .

Unlike the above cases, two circles in the W-plane may have identical radii, as shown in

Fig. 6(c). Then, two exterior tangent lines are parallel, and the regions β, δ, and ε disappear. Because δ vanishes in this configuration, two intersections between inverse-mapped tangent circles merges to one. In other words, both tangent circles are tangent at point z3. These cases

are illustrated in Fig. 7(αD2), (γD2), and (φD2). Note that even though two generator circles in the Z-plane have identical radii, the radii of mapped circles in the W-plane are not necessarily identical. Since detailed descriptions for the cases are similar to the above-mentioned cases, they are not further elaborated here.

<Insert Fig.6.> <Insert Fig.7.>

The above cases are based on the assumption that L1 and L2 are distinct (i.e., 21 LL ≠ ).

However, it is possible that L1 and L2 are not distinct. Suppose the radii of three given generator circles are identical. Then, W2 (in addition to W1) also degenerates to a point, and therefore L1 and L2 should reduce to an identical line (i.e., 21 LL ≡ ), and regions β and γ become

simultaneously null. The interpretations of the other regions are the same as before. The examples for such a case are shown in Fig. 8, where the circles are generators in the initial Euclidean plane before the circles are shrunk.

Case D1: Fig. 8(a). If O lies on L1 (hence on L2, too), there exist two tangent circles in the Z-plane. However, the tangent circles degenerate to tangent lines in the Z-plane since both line L1 and L2 tangent to (in fact, passing through) W1 and W2 pass through the origin of the W-plane. Note that both tangent lines in the Z-plane are parallel. Hence, the three given generator circles are collinear.

Case D2: Fig. 8(b). If O does not lie on L1, it should lie on either side of region α. Suppose that O lies on α1. Then, two tangent circles in the original Euclidean plane are concentric with three generator circles in-between. 1

1~ −c , which is the inverse-map of L1,

inscribes the inverse-mapped circles of the degenerate W1 and W2 simultaneously since O

13

is not on the same side with W1 and W2 with respect to L1. Note that region α does not include lines L1 and L2. Similarly, 1

2~ −c circumscribes them. Hence, degenerate W1 and

W2 are in-between L1 and L2. This means that one tangent circle inscribes the given circles and the second circumscribes the given circles, and two circles have the same center with different radii.

<Insert Fig. 8>

The observations explained above can be summarized by the following pseudo-code to

determine which case the configuration of given generator circles represents and to calculate the center of circumcircle if one exists. Note that the center of the circumcircle is the position of the Voronoi vertex.

EDGE GEOMETRY

The calculation of vertex geometry, which is the position of the Voronoi vertex of a

Algorithm : Compute Circumcircle(s) INPUT : c1, c2, and c3 ( 13 rr ≤ and 23 rr ≤ )

OUTPUT : number of circumcircles and corresponding circumcircles. 1. Shrink circles with respect to r3. 2. Compute W1 and W2 by Eq. (3). 3. Compute exterior tangent lines, L1 and L2.

4. Determine the location of the origin in the W-plane. (i.e., α1, α2, β, γ, δ, ε, φ1 or φ2) A. 1. case α1 : number of CC = 1, return 1

2−c

2. case α2 : number of CC = 1, return 11−c

B. case β : number of CC = 0 C. case γ : number of CCs = 2, return 1

1−c and 1

2−c

D. case δ : number of CC = 0 E. case ε : number of CC = 0 F. 1. case φ1 : number of CC = 1, return 1

2−c

2. case φ2 : number of CC = 1, return 11−c

14

circle set Voronoi diagram, should be performed in the middle of the topology update from the topology of a point set Voronoi diagram. Once the correct topology of a circle set Voronoi diagram is constructed, it is necessary to compute the correct geometry of Voronoi edges to complete the circle set Voronoi diagram.

The geometry of Voronoi edges is known as bisectors between generators. In our case, the bisectors can be a portion of either a line or a hyperbola. Linear bisector occurs between two circles with identical radii, and hyperbolic bisector occurs between circles with different radii. The cases of parabolic and elliptic arcs do not occur in our problem.

Among various possible representations for the bisectors, one proposed by Persson and Held (Held, 1991; Held et al., 1994; Persson, 1978) and one by Kim (Kim et al., 1995) are noteworthy. Persson and Held represented the edge equations using a parametric curve obtained by solving the intersection equations of the offset elements of generators. In this representation, both the line and the hyperbola are represented in different forms. In addition, a few degeneracies may occur in representing the equations of edges. On the other hand, Kim used a rational quadratic Bézier curve to represent the edges (Kim et al., 1995). In this representation, any type of bisectors, for example, line, parabola, hyperbola, or ellipse, can be represented in a unified form. Hence, this representation may simplify applications, such as offsetting (Kim, 1998), involving manipulations of edge geometries. Therefore, we have employed the rational quadratic Bézier curve representation for the edges.

Bisectors in a rational quadratic Bézier representation An edge of a target Voronoi diagram is either a hyperbolic arc or a straight line. It is

known that a conic arc can be converted into a rational quadratic Bézier curve form which is defined as

[ ]1,0)1(2)1(

)1(2)1()( 2

212

0

22

21102

0 ∈+−+−

+−+−= t

twttwtwtwttwtwt bbb

β (5)

where b0, b1 and b2 are the control points, and w0, w1 and w2 are the corresponding weights. It is known that a conic curve (i.e. a line, a parabola, a hyperbola, and an ellipse) can be converted

into a rational quadratic Bézier curve β(t) if two points b0 and b2 on the curve, two tangents of the curve at b0 and b2, and another passing point p on the curve are known. Since it is a quadratic Bézier curve, b0 and b2 should be the first and the third control points of the Bézier curve, and the second control point b1 is given by the intersection of the tangent lines of the curve at b0 and b2 (Farin, 1996; Farin, 1999).

15

Once the control points have been found, it is necessary to compute the weights associated with the control points. Without loss of generality, it can be assumed that the conic curve is in a standard form, i.e. w0 = w2 = 1. Then, w1 is given as

20

11 2 ττ

τ=w (6)

where τ0, τ1 and τ2 are the barycentric coordinates of a point p. Note that p is a point through which the bisector passes through, and it is assumed to be interior to a triangle 210 bbb∆ . For

the details of this computation, readers are referred to (Farin, 1996; Farin, 1999).

Tangent vectors and a passing point In our problem, the positions of two vertices of a Voronoi edge play the role of the

control points b0 and b2. To compute the other control point b1, we need to compute the tangent vectors of the bisector at b0 and b2, which can be done easily as follows.

Suppose two circles c1 = (p1, r1) and c2 = (p2, r2), r1 ≥ r2, are given as shown in Fig. 9(a). Let v be an arbitrary point on the bisector, which is a hyperbolic arc with foci p1 and p2, and let a line L bisect the angle 21vpp∠ at v. Let 1

~c and 2~c be shrunk circles of c1 and c2

with radius 021 >−= rrr , respectively, as shown in Fig. 9(b). Then, 2~c degenerates to a

point p2, and r=−−− 21 pvpv . Let q be an arbitrary point on line L, vq ≠ . Then,

r<−−− 21 pqpq since aqpq −=− 2 and 11 pqapaq −>−+− .

Therefore, q cannot lie on the hyperbolic bisector, and line L should be tangent to the bisector at v because a line L cannot intersect with the hyperbola except at v.

Hence, the tangent vector of a bisector at a Voronoi vertex v can be easily computed by an angle bisector of 21vpp∠ . This is also trivially true when r1 = r2 because the bisector of

two circles with identical radii becomes a perpendicular linear bisector between the two center

points of the circles. Note that this perpendicular bisector bisects the angle at v, too. The case in which generators degenerate to points is also not an exceptional case. In addition, our observation holds true even when the generator circles intersect each other, since the above argument is based on the center points of the generators.

<Insert Fig.9.>

The remaining problem that we must address is the calculation of the passing point on a bisector. This can be handled easily by locating a point on a line segment, defined by the

16

center points of generator circles, which is equi-distant from the generators. When this passing point lies inside of a triangle 210 bbb∆ , the equation of the Voronoi edge can be computed by

Eq. (6). In this case, the computed edge also lies inside of the triangle. Suppose, however, this passing point lies outside of triangle 210 bbb∆ . In this case,

barycentric coordinate τ1 becomes negative, while τ0 and τ2 are positive. Since w1 also becomes negative due to Eq. (6), the curve computed in a rational Bézier form is not in a convenient representation. Note that it is very convenient to have the desired curve segment for an edge be inside of triangle 210 bbb∆ with an ordinary parameter range [0, 1]. In this case, we can

simply obtain a desired curve segment by taking the weight w1 as its absolute value (Farin, 1996). In addition, when a bisector is a line or a near-line, it is necessary to detect that it is the case. Otherwise, the algorithm may fail the calculation of the edge equation, since a numerical problem may occur during the intersection calculation between two tangent lines.

IMPLEMENTATION AND EXPERIMENTS

The algorithm to compute the Voronoi diagram of a circle set has been implemented in Microsoft Visual C++ on an Intel Celeron 300MHz processor. It consists of four major modules: i) a module to construct a point set Voronoi diagram, written by one of the authors and available on the internet (Sugihara, 2000), ii) a main module to compute the desired Voronoi diagram of the circle set, iii) a module to load and store data, and iv) a graphic user interface.

The main module consists of three submodules: i) an edge flipping submodule, ii) a circumcircle calculation submodule, and iii) an edge geometry (bisector) calculation submodule. Among these, the edge flipping submodule, which consists of testing the topological validity of an edge and the execution of flipping, is the main concern of the previous paper (Kim et al, 2000). The module to compute the position of the Voronoi vertex when the corresponding generators are given, and a module to compute the rational quadratic Bézier equation of edge geometry are the main concerns of this paper.

Fig. 10 shows an example of the constructed Voronoi diagram of a circle set. In Fig. 10, the 3,500 circles generated at random do not intersect each other and have different radii. Fig. 10(a) shows the result, and Fig. 10(b) shows the zoom-up of the boxed region in Fig. 10(a).

<Insert Fig. 10>

Fig. 11 shows examples of computed Voronoi diagrams of circle sets. The generator set

for Fig. 11(a) is 1,000 non-intersecting random circles with random radii. In the case of Fig.

17

11(b), the set consists of 800 circles with random radii where the centers of the circles are located on a spiral curve plus one large circle in the center. Fig. 11(c) shows a case with 400 circles with random radii where the centers of the circles are cocircular plus one large circle in the center. Fig. 11(d) is a case identical to the case of Fig. 11(c) except that the radii of cocircular circles are identical.

<Insert Fig. 11.>

Fig. 12 shows the computation time consumed by the VD(C) and VD(P) for the cases of examples shown in Fig. 11, with respect to a number of generator sets with varying cardinality. In the figure, the computation time taken by a code to compute the Voronoi diagram

of a point set is denoted by VD(P), and the time taken by our code to compute the Voronoi diagram of a circle set is denoted by VD(C). Note that the time denoted by VD(C) does not include the time taken by a preprocessing, which is actually the time denoted by VD(P). Therefore, the actual computation time to compute VD(C) from a given circle set is the accumulation of both computation times. Also, note that VD(P) is done using a code written by one of the authors and is available on the internet (Sugihara, 2000).

Comparing VD(C) with VD(P), it can be deduced that VD(C) is not as large as possibly expected. In the cases of Fig. 11(c) and 11(d), VD(C) is even much smaller than VD(P). Also, note that the coefficients of determination, denoted as R2, in a linear regression method strongly suggest that the average running behavior is linear, even though the worst-case scenario is theoretically quadratic. Note that the coefficient of determination is the square of correlation coefficient and accounts for the variability in the data explained by the regression model (Hines and Montgomery, 1990).

We have experimented with many other cases, and all the cases show similar linear patterns. Based on these experiments we claim that the proposed algorithm is very efficient and robust. Even though the worst-case scenario, O(n2), is theoretically possible, it is our speculation that such a case would be very difficult to meet in reality.

<Insert Fig. 12.>

Fig. 13 and Fig. 14 show that our algorithm works for the cases in which the circles

intersect each other. We have tested the code for the case where many circles intersect simultaneously. The only case that our algorithm cannot handle is when a circle is completely contained in the interior of another, which is reasonably assumed not to happen. Fig. 13 is a case where pairs of circles intersect. Fig. 13(a) shows the result of the Voronoi diagram of the point

18

set, and (b) shows the Voronoi diagram of the circle set. Fig. 14(a) and (b) are cases in which three and four circles intersect simultaneously, respectively. Note that the definition of equi-distant point from a set of three or more points can sometimes be ambiguous. Fig. 14(c) shows a case where several intersecting circles form a loop. Notice that the inner boundary of the circles will form a polygon defined by arcs. We expect that our approach can be extended to get a robust algorithm to compute the Voronoi diagram of a polygon, which is very difficult to obtain.

<Insert Fig. 13.> <Insert Fig. 14.>

19

CONCLUSIONS Presented in this paper are algorithms to compute the exact geometry of vertices and

edges of the Voronoi diagram of a circle set, given the correct topology of the circle set Voronoi diagram. The circles are located in a two dimensional Euclidean space, the radii of the circles are not necessarily equal, and the circles are not necessarily disjoint. The algorithm correctly works in conjunction with the first paper of the series by the same authors dealing with the construction of the correct topology of the Voronoi diagram of a circle set from the topology of the Voronoi diagram of a point set, where the points are the centers of the circles (Kim et al., 2000).

Given three circle generators in the middle of the topology construction process, the possible position of a vertex is computed by treating the plane as a complex plane and transforming it into another complex plane via a linear fractional transformation along with some adjustments in the parameters. It turns out that the problem, which is in fact the well-known Apollonius 10th problem, can be solved quite easily in a complex plane. The computation is fast, the solution is precise, and the algorithm is robust.

After the correct topology is constructed with the correct geometry of the vertices, the geometry of the Voronoi edges needs to be computed. The representation of the edge equation employed in this paper is a rational quadratic Bézier curve, and the actual computation is done via a few simple arithmetic.

We are currently investigating the possibility of extending our experience and knowledge of this problem to the case of a polygon, which may consist of line segments as well as circular arcs. We expect that a similar approach taken in this as well as the first paper can be more generalized to polygons on a plane, to spheres in 3D, etc., to get algorithms which are as robust as the algorithm to compute a point set Voronoi diagram.

20

ACKNOWLEDGEMENTS

This work was supported in part by the Korea Science and Engineering Foundation (KOSEF) through the Ceramic Processing Research Center (CPRC) at Hanyang University. The authors thank to an anonymous referee for the constructive comments.

21

REFERENCES Boyer, C. B. (1968), A History of Mathematics, Wiley, New York. Courant, R. and Robbins, H. (1996), What is Mathematics?: An Elementary Approach to Ideas

and Methods, 2nd edition, Oxford University Press, Oxford. Dörrie, H. (1965), 100 Great Problems of Elementary Mathematics: Their History and Solutions,

Dover, New York. Drysdale, R.L. and Lee, D.T. (1978), Generalized Voronoi diagram in the plane, Proceedings of

the 16th Annual Allerton Conference on Communications, Control and Computing, 833-842. Drysdale, R.L. (1979), Generalized Voronoi diagrams and geometric searching, Ph.D. Thesis,

Department of Computer Science, Tech. Rep. STAN-CS-79-705, Stanford University. Farin, G. (1996), Curves and Surfaces for Computer-Aided Geometric Design: A Practical

Guide, 4th edition, Academic Press, San Diego. Farin, G. (1999), NURBS: From Projective Geometry to Practical Use, 2nd edition, AK Peters,

Natick. Fortune, S. (1987), A sweepline algorithm for Voronoi diagrams, Algorithmica 2, 153-174. Hamann, B. and Tsai, Po-Yu (1996), A tessellation algorithm for the representation of trimmed

NURBS surfaces with arbitrary trimming curves, Computer-Aided Design 28 (6/7), 461-472.

Held, M. (1991), On the Computational Geometry of Pocket Machining, LNCS, Springer-Verlag.

Held, M., Lukács, G. and Andor, L. (1994), Pocket Machining Based on Contour-Parallel Tool Paths Generated by Means of Proximity Maps, Computer-Aided Design 26 (3), 189-203.

Hines, W. and Montgomery, D., (1990), Probability and Statistics in Engineering and Management Science, John Wiley & Sons.

Johnson, R. A. (1929), Modern Geometry: An Elementary Treatise on the Geometry of the Triangle and the Circle, Houghton Mifflin, Boston.

Kim, D.-S., Hwang, I.-K. and Park, B.-J. (1995), Representing the Voronoi diagram of a simple polygon using rational quadratic Bézier curves, Computer-Aided Design 27 (8), 605-614.

Kim, D.-S. (1998), Polygon offsetting using a Voronoi diagram and two stacks, Computer-Aided Design 30 (14), 1069-1076.

Kim, D.-S., Lee, S.-W. and Shin, H. (1998), A cocktail algorithm for planar Bézier curve intersections, Computer-Aided Design 30 (13), 1047-1051.

Kim, D.-S., Kim, D. and Sugihara, K. (2000), Voronoi diagram of a circle set from Voronoi diagram of a point set: I. Topology, (Submitted to Computer Aided Geometric Design).

Kreyszig, E. (1993), Advanced Engineering Mathematics, 7th Edition, John Wiley & Sons.

22

Lee, D.T. and Drysdale, R.L. (1981), Generalization of Voronoi diagrams in the plane, SIAM J. COMPUT. 10 (1), 73-87.

Mäntylä, M. (1988), An introduction to solid modeling, Computer Science Press. Okabe, A., Boots, B. and Sugihara, K. (1992), Spatial Tessellations Concepts and Applications

of Voronoi Diagram, John Wiley & Sons. Persson, H. (1978), NC machining of arbitrarily shaped pockets, Computer-Aided Design 10 (3),

169-174. Preparata, F.P. and Shamos, M.I. (1985), Computational Geometry: An Introduction, Springer-

Verlag. Rokne, J. (1991), Appolonius’s 10th Problem, Graphics Gems II, Edited by Arvo. J, 19-24. Sharir, M. (1985), Intersection and closest-pair problems for a set of planar discs, SIAM J.

COMPUT. 14 (2), 448-468. Sugihara, K. (1993), Approximation of generalized Voronoi diagrams by ordinary Voronoi

diagrams, Graphical Models and Image Processing 55 (6), 522-531. Sugihara, K. (2000), http://www.simplex.t.u-tokyo.ac.jp/~sugihara/.

23

(a) (b) (c) (d)

Fig. 1. Circles simultaneously tangent to three generator circles shown as shaded ones. (a) one circumcircle, (b) three circles where one generator is internal to each circle while two generators are external, (c) three circles where two generators are internal while one generator is external, and (d) all three generators are inside a circle.

24

(a) (b) (c)

Fig. 2. Cases of different numbers of circumcircles. (a) no circumcircle, (b) one circumcircle, and (c) two circumcircles.

25

c1

c2

c3

2z

1z

3z

c

1~c

2~c

33~c=z

2z

1z

c~

(a) (b)

Fig. 3. Shrunk generator circles and inflated circumcircle. (a) given generator circles and a circumcircle, (b) shrunk generators and a circle passing through z3.

26

W1

W2

L

z2

z11

~c

2~c

33~c=z

c~

O

(a) (b)

Fig. 4. Linear fractional transformation W = W(z) = 1 / (z - z3). (a) Z-plane, and (b) W-plane. 1

~c and 2~c in the Z-plane map to W1 and W2 in the W-plane, and L in the

W-plane inverse maps to a circumcircle c~ in the Z-plane.

27

W1

W2

L1

L2

L3

L4

O1

~c

2~c 33

~c=z

1z

2z

13

~−c

11

~−c

12

~−c1

4~−c

(a) (b)

Fig. 5. Inverse mapping Z = Z(w) = 1/w + z3 which maps from the W-plane to the Z-plane. (a) W-plane, (b) Z-plane.

28

W1

W2

L1

L2

α (α1)

α (α2)

β

γ (γ2)

δ

φ(φ1)

ε

ε

γ (γ2)γ (γ1)

φ(φ2)

(a)

W2

L1

L2

αD1(α1)

αD1(α2)

γD1(γ2)

δD1 = W1

φD1(φ1)

φD1(φ2)βD1

γD1(γ1)εD1

εD1

(b)

γD2 (γ1)W2

L1

L2

αD2 (α2)

W1

φD2 (φ1)

γD2 (γ2)

γD2 (γ2)

αD2 (α1)

φD2 (φ2)

(c)

Fig. 6. Configurations of circles in the W-plane and regions defined by two exterior tangent lines L1 and L2. (a) general configuration of three generator circles and six disjoint regions of the W-plane, (b) two generator circles with smaller radii in the Z-plane are identical, and (c) two circles in the W-plane have identical radii.

29

11

~−c

12

~−c

1~c

2~c

3~c

1−δ

(α1) (α D1) (αD2)

(β) (β D1) (γ1) (γ2)

(γ D1) (γ D2) (δ) (ε)

(ε D1) (φ ) (φ D1) (φ D2)

Fig. 7. Inverse mappings from the W-plane to the Z-plane.

30

(a) (b)

Fig. 8. Degenerate cases (shown in the initial Euclidean plane) when three generators have identical radii.

31

p1

p2

v

CC1

c1

c2p1

p2

v

CC1'

L

q1

q2

a

1~c

(a) (b)

Fig. 9. Tangent vectors on a bisector. (a) bisector for two circles and a tangent vector

on it, (b) a tangent line on the bisector at v.

32

(a)

(b)

Fig. 10. Voronoi diagram of 3,500 random circles. The circles do not intersect each other and have different radii. (a) overall shape, (b) zoom-up of the boxed region in (a).

33

(a) (b)

(c) (d)

Fig. 11. Examples (non-intersecting circle generators). (a) 1,000 random circles, (b) 800 circles with random radii with the centers on a spiral curve plus one large circle in the center, (c) 400 circles with random radii with the centers cocircular plus one large circle in the center, and (d) case (c) with identical radii for the surrounding circles.

34

R2 = 0.999

R2 = 0.9788

0

1500

3000

4500

6000

0 700 1400 2100 2800 3500 4200

number of generators

time

(ms)

VD(C) VD(P)

(a) (b)

(c) (d)

Fig. 12. Computation time behavior of the cases of Fig. 11. Dotted line and R2 denote regression line and coefficient of determination, respectively. (a) random non-intersecting circles, (b) circles with random radii with the centers on a spiral curve plus one large circle in the center, (c) circles with random radii with the centers cocircular plus one large circle in the center, and (d) case (c) with identical radii for the surrounding circles.

R2 = 0.9976

R2 = 0.9994

0

4000

8000

12000

16000

0 700 1400 2100 2800 3500 4200

number of generators

time

(ms)

VD(C) VD(P)

R2 = 0.9976

R2 = 0.9982

0

4000

8000

12000

16000

0 700 1400 2100 2800 3500 4200

number of generators

time

(ms)

VD(C) VD(P)

R2 = 0.9992

R2 = 0.9964

0

1000

2000

3000

4000

0 700 1400 2100 2800 3500 4200

number of generators

time

(ms)

VD(C) VD(P)

35

(a)

(b)

Fig. 13. Voronoi diagram of a few random circles, where some circles intersect each other and have different radii. (a) the Voronoi diagram of point set, (b) the Voronoi diagram of circle set.

36

(a) (b)

(c)

Fig. 14. Examples when the generators intersect each other. (a) three circles intersect simultaneously, (b) four circles intersect simultaneously, and (c) pairwise intersections form a loop with some islands.