1. Introduction
The circle play an import role in history, and used in many different filed such as geometry, engineering, mechanics, architecture design, art design. Many researches tried to find properties for circle [
1,
2], so that properties of the circle can be used in the application properly. In infographics, circles are commonly used in data visualization[
3], such as in pie charts, bubble charts[
4,
5], donut chart, circular treemaps, radial bar chart, chord diagram, to convey categorical or quantitative data in visually effective way. The bubble chart use bubble, represented by a circle, whose center and radius can represent at least 3 dimensional data. For example, a manufacture company want its product a bubble chart, so that x represents the product categories, y represents average sales price, and r represents the total unit sold. These circles can combine with other chart. Heer, J., Bostock, M., & Ogievetsky, V. (2010) [
6](See
Figure 1), the geospatial data combine with pie chart, it shows the percentage of the obese, normal, overweight percentage, represent by a pie chart, in every states. In this case, (x,y) position is not so import, as long as it location is inside the associated state, the size of circle represents the total population. In
Figure 1(a), 5 dimensional data are represented, include state categories and obese, normal, overweight, total population in each state. If we want know only the percentage of the overweight population, the pie chart in
Figure 1(a) can be replaced by a circle whose size represents the percentage of the overweight population, as show in
Figure 1(b). In this figure, the designer tried to avoid the overlapping of circles, and did not ask tangency properties among circle.
Some researchers give constraints among circle, such as tangent internally/externally. For example, Wang, W., Wang, H., Dai, G., & Wang, H. (2006) [
7](see
Figure 2) want to see the tree structure for file system using nested circles. The circles tangent externally means this two are represented at the same level (brother relationship). The circle inside a circle means that these two circles are in different level (father/son relationship). See
Figure 2(b). The author also add cylinder in the Figure, the cylinder′s height represents one more dimension of data. For example, the height of the cylinder can represent the size of memory used in this directory. In this figure, the tangency property among circle are used, so to minimize the waste space.
The circle tangency problem has been investigating for many years. For example, the Apollonius problem try to find circles tangent to three circles [
8], and the malfatti problem try to find three circles inside a triangle with the properties that each circle tangent to other two circles externally, and also tangent to two sides of the triangle [
9]. The circle packing problem [
10] try to put non-overlap circles inside an area, such as triangle, square, circle, and find a way to produce many circles inside the area, such that the total area of these circles is maximum [
9,
11,
12,
13]. These circles may have some constraints, such as the same radii, or two different radii. To solve these problem, some researcher uses mathematical analysis geometrically or algebraically, and prove the solution is optimal. Some researchers use heuristic algorithms to find the solution. Dckard Specht [
14] gives algorithms to find n circles with the same radius inside a unit circle. It finds all solutions with maximum circles area for the case n=1 to 1000, some solutions are optimal, and some solutions are still a conjecture. Notice that for the optimal solution the circles inside the unit circle tangent to other circle often. When this problem allows two different radii for the inside circles, the problem become more complex [
15]. The more radii the problem allowed, the more complex the problem is.
To construct circle tangency graph, we need to describe the circle packing theorem [
16]:
For every connected simple planar graph G, there is a circle packing in the plane whose intersection graph is (isomorphic to) G. The intersection graph, also called tangency graph, whose vertex represent circle, and edge connecting two vertices represent these two circles tangents to each other.
By this theorem, given a simple planar graph G, we can construct its associated circle packing chart.
There are many different algorithms to construct different circle tangency chart. Collins and Stephenson construct a simple planar graph G, and construct its associated circle tangency chart [
16]. For some applications, such as the bubble chart combine with word cloud, it emphasis on the radius of circles and put words inside the circle, and the larger circle contains the words which shows more frequent in a book, in some author’s writing, in a column, etc. This radii for circles in this chart may be different, so that the frequency the word shows is easy to identify. Notice that the circle may/may not tangent to its neighbor circles. For visual effect, the larger circle with word inside, which represents the word written by the author more often, should put on the center of the chart, because the center of the chart get more attention by the reader.
In this research, we would like to find a way to construct bubble chart, so that all of the bubble circle satisfied certain criterion. We start from a unit circle centered at the origin, and extend circles layer by layer, from inside out, so that all circles have tangency properties with one or two circles in previous layer, two circles the same layer, and tangent to a large circle centered at the origin.
Let us classify the bubble chart we want to construct, and these chart associated with the problem we need to solve, including BC[1,n], BC[1,n,n], BC[1,n,n,…,n] and BC[1,n,m
n] problem. In these problem, there is always a unit circle in the center, and a silhouette circles tangent to circles at the last layer. The BC[1,n] problem is the problem to generate the first/last layer of n circles, as shown in
Figure 3(a) for n=8. The BC[1,n,n] problem has two layers of circles, as shown in
Figure 3(b) for n=6. BC[1,n,n,n,…] is the extension of BC[1,n] and BC[1,n,n], it can be construct by more than two layers. The last bubble chart is BC[1,n,m
n]. In BC[1,n], the first layers has n circles tangent to the center unit circles, and the second layer has m
n circles tangent to the first layer of circles in a special way. Because there is a silhouette circle tangent to the circles at the second layer, there are m different radii of circles at the second layer. The figures for BC[1,6,2
6] and BC[1,6,3
6] problem are shown in
Figure 3(c)(d) respectively.
In this paper, the closed form for the circles radii in BC[1,n], BC[1,n,n] and algorithms to construct BC[1,mn] are provided.
2. Closed form solution for BC[1,n], and BC[1,n,n]
Before the description for all problems, including BC[1,n] and BC[1,n,n],BC[1,n,.., n],BC[1,n,m
n], we would like define some terms. Consider a series of circles C
0,C
1, C
2, …, C
n-1, C
i tangent to C
i-1 and C
i+1 explicitly, i=1, …, n-2, we call these circles a circle chain, as shown in
Figure 4(a). When C
0 also tangent to C
n-1, we call it a circle ring with size n, as shown in
Figure 4(b). We asked the bubble chart we find to solve the associated problem has the property that every circles in the inner layer (all layer except the last layer) has a circle ring around it.
For the BC[1,n] problem, we would like to solve the radii of the circles in a circle ring with size n. The radii for all circles are the same, as shown in
Figure 5. It is easy to see that r=
, where
=
. The radius of the silhouette circle whose center is at the origin with radius 1+2r.
For the BC[1,n,n] problem, we need to consider the radius of the circle
s at the second layer. Consider the case for n=6, as shown in
Figure 6(a). Consider figure 6(b), the blue and red circles represent first and second layer of BC[1,n,n] respectively. In figure 6(b), the angle c is equal to the interior angle of a regular convex n-gon, which is (1-
)π. Because c+2β+(π-2α)=2π, so β=α+
. From cos(α)=
, cos(β)=
=cos(α+
)=cos(α)×c-sin(α)×s, where c=cos
, s=sin
, we can derive c
2r
22-2(c+s
2)r
1r
2+r
12c
2=0. There are 2 solutions for this equation, one is the larger radius circle tangent to the first layer and ‘outside’ the layer, and the other small radius is the radius of circle ‘inside’ the layer. So, we find r
2=
, where c=cos
, s=sin
. The value
can be simplify to
. The radius for the silhouette circle will explain when we describe the BC[1,n,…,n].
Notice that we can use the above idea to find the radius of circle ring in the further layer. We can generate a recursive equation rn=Drn-1, r1=, n>1, where D=, s=sin(), c=cos(). Notice that D>1 because ≥1, n>2, so ri≥ri-1. That is, the circles in exterior circle ring has larger radius than the circles in interior circle ring, start from the first circle ring. Notice that is a constant, so we can compute once and find the radius for next layer easily.
We know there is a large silhouette circle tangent to each layer of circles. Assume Ri is the radius of the large silhouette circle, it’s value can be easily computed with the following theorem.
Theorem 1: The radius for the silhouette circle in different layers is:
R0=r0=1
R1=1+2r1
Ri=(Ri-2-ri-2)+f(ri-2,ri-1)+f(ri,ri-1)+ri, where i>1, f(,)=
Proof of Theorem 1. The proof for R
0=r
0=1, R
1=1+2r
1 is trivial. Assume f(
,) =
. This function calculates the distance of the dashed line in
Figure 7(a), and consider the value R
i, i>1, R
i can be computed by the sum of 4 values(see
Figure 8(b), start from R
i-2-r
i-2, and followed by f(r
i-2 ,r
i-1), f(r
i ,r
i-1) and r
i, so R
i =(R
i-2 -r
i-2)+f(r
i-2 ,r
i-1)+f(r
i ,r
i-1 )+r
i. □
From theorem 1, we have the following corollary:
Corollary 1: The radius of the silhouette circle for n-th layer of circle ring is (center circle is a unit circle):
R0=1; R1=1+2r1; Ri=Ri-2+Di-3()r1, n>2, where r1=, D=, s=sin(), c=cos().
Note that when we know the value n, the value and r1 is a constant. The new value Ri can be computed by a multiplication (D and a computed value) and an addition (with Ri-2). This equation including R2, which is the radius of the silhouette circle for BC[1,n,n] problem.
Now, we can list a table, where n=5,6,7,8,9, and display the radius for the circle at first through sixth layer of BC[1,n,n,n,n,n,n]. We also list the radius of silhouette circle R
i in the
Table 1. We can extend the further layer with simple computation.
3. Numerical solution for BC[1, n, m×n]
Consider the BC[1,n], can we extent the chart one more layer (second layer) with 2n circle, and these circles has the same radius? Consider in
Figure 8(a), it can be proved that when n=6, we can find the second ring, which has 12 circles, and circles in the first layer tangent to the circles in the second layer in a special way. Furthermore, all the circles have the same radii. Although we can find a silhouette circles for it, it is not the figure we are looking for because the circle in the first layer did not have circle ring around it. Now, consider the case that in
Figure 8(b), we want construct BC[1,6,2
6], the second layer has two different colors of circle, red and green. If these two circles has the same radii, there are two ways to compute the radius of the silhouette circle, one is connecting the line of the center circle to the center of red boundary circle, and find R′=1+2r
1,0+2r
2,0, where r
20 is the radius of red (and green) boundary circle. The other way to compute the radius of the silhouette circle is connecting the line of the center circle to the green boundary circle, and find R=f(1,r
1,0)+f(r
2,1,r
1,0)+r
2,1, where f(
,)=
. After calculation, we find R≠R′。This contradiction tells us that the radii for red and green boundary circles are different.
Now, we want to solve the BC[1,n,2
n] algebraically. We need to generate a system of equation, and solve the system of equation via some method such as Newton method. Consider
Figure 9, assume C
i(x
i,y
i,r
i) represents a circle C
i, with center (x
i, y
i) and radius r
i. The center unit circle is C
0, the circles on the first layer are C
1 and C
2, we can find all values for C
i(x
i,y
i,r
i), i=0,1,2 when we know the value of n. They are: C
0(0,0,1), C
1(1+r, 0, r), and C
2((1+r)cos(
), (1+r)sin(
)), where r =
and
=
Assume the circles in the second layers are C
3, C
4, C
5, then the variable (x
i, y
i, r
i), i=3,4,5 and the radius for the silhouette circle are the variables. Because the circles C
5 is symmetry to the circle C
3, with respect to the line passing (0,0) and center of C
4, we can find the (x
5,y
5, r
5) values from (x
3, y
3, r
3). So we have 7 variables x
4, y
4, r
4, x
5, y
5, r
5, R, where C(0,0,R) is the silhouette circle. We need to generate 7 equations to find the solution. To generate the system of equation, we need to consider the externally tangency properties, that is, the distance between two circles centers is equal to the sum of their radii. To reduce the number of equations and variables, we try to substitute a variable using other variables, so that the number of equations reduced.
In this case, the circle center can be found from the radius of the silhouette circle. So, (x3,y3)=(R-r3,0)=(1+2r1+r3,0) and (x4,y4)=((R-r4)cos(), (R-r4)sin()). So, x3 is a function with r3 as a variable, y3 is 0, x4, y4 are functions with variables R and r4. We can substitute these 4 variables using other variable in the system of equation, so we need 3 equations only. There are:
C
3 tangents to and contains in C: 1+2r
1+2r
3=R [
1]
C
4 tangents to C
3 explicitly: (x
4-x
3)
2+(y
4-y
3)
2=(r
4+r
3)
2 [
2]
C
4 tangents to C
1 explicitly: (x
4-x
1)
2+(y
4-y
1)
2=(r
4+r
3)
2 [
3]
After the substitution of the variable x3, y3, x4, y4, this system of equation becomes:
((R-r
3)cos(
)-(1+2r+r
3))
2+((R-r
3)sin(
))
2=(r
3+r
4)
2 [
5]
((R-r
3)cos(
)-(1+r))
2+((R-r
3)sin(
))
2=(r+r
4)
2 [
6]
We know r = and =, this system of equation has 3 variables R, r3, r4. These three equations are degree one, two, two, so it should have 4 solutions.
Now, we can solve this problem numerically using Newton method. However, we did not know what initial value we should guess, so that the solution (r3, r4, R) Newton method find is the real solution we want. The other thing worries us is the system of equation we generate when m>2 become more complex. We need to generate a system of equation for each m value, and the variable for circle center becomes hard to substitute. So we proposed another algorithm to solve this problem.
Before the explanation of the proposed algorithm, we define the SC(C), which is the sum of angle computation for a circle C with the circle ring surround it. Let’s consider three circles C
0, C, C
1 tangents to each other, and has radii r
0, r, r
1 respectively. We denote with angle(r
0, r, r
1) the cosine the angle α between two line segment, one connect the center of C
0 and C, and the other connect the center of C and C
1, as shown in
Figure 10. Notice that angle(r
0,r, r
1)=cos
-1(
) . This equation can be easily derived from the cosine rule.
Consider a circle ring tangent to one circle, as shown in
Figure 11(a), and r
i is the radius of C
i. We denote SA(C) is the sum of angle(r
0, r, r
1), angle(r
1, r, r
2), …..angle(r
n-1,r,r
0), which should equal to 2πif the circle ring tangent to the center circle properly. However, in some case, the radius of the center circle is not correct, SA(C) may less than 2π(See
Figure 11(b)), or greater than > 2π(See
Figure 11(c)).
Consider
Figure 12, it is easy to compute the center and radius for the circles in the first layer. The center and radius for the circles in the second layer, we need to know only half of the circles from C
1,0 to C
1,m, because of the symmetry properties among circles. After we find these circles, we compute SA(C
1,0), and adjust r
2,0, the radius of C
2,0, and r (the radius of the silhouette circle C). Repeat the above process by binary subdivision method, until SA(C
1,0)= 2π. The algorithm shows below:
Algorithm : for BC[1,n, mn], when m>1.
1. Given a fixed radius big enough (such as 2*r1,0) for r2,0. asum=0. eps=0.001
2. while |asum-2π|>eps:
2.1 Find C from n, r0, r1,0, r2,0.
2.2 For i from 1 to : Find one circle C2,i which tangents to C1,0, C2,i-1 and C.
2.3. Calculate asum = SA (C1,0).
2.4. if asum>2π+eps, reduce r2,0.
2.5. if asum<2π-eps, enlarge r2,0.
3. We find the C2,0, C2,1, …., C2,m, R. Display the result.
There are more details we need to know when we implement the above algorithm. In step 1, the radius we select must big enough, so that the SA(C
1,0)> 2π in the first iteration. In step 2.2, we need to find one circle tangent to 3 circles, it is the Apollonius problem [
17]. We know there are 8 circles tangent to 3 circles in general, which one is the one we select?
The method we use try to solve the Apollonius problem [
17] with the idea of cycles (oriented circle)[
18]. The idea is to consider 3D points (x,y,r) to represent a oriented circle (also call it cycles) which center at (x,y) with radius |r|。When r>0, this 3D point represents the circle oriented counter-clockwise. When r<0, this 3D point represents the circle oriented clockwise. When r=0, this 3D point represents a point in 2D. Consider a right circular cone whose vertex is at this 3D point with the properties that its height equal to |r|, any two points on this cone has the properties that these two 3D points, represent two cycles in 2D, tangents properly to each other. The ‘tangent properly’ means this two cycles not only tangent to each other, but has the same tangent direction at the tangent point. In
Figure 13, the C
2,0 and C
1,0 tangent to each but not tangent properly because the tangent point for this two circle has different direction. Now, Apollonius problem in 2D becomes the problem that finding the intersection points of 3 right circular cone in 3D. We generate three equations for these 3 circular cone, there are two solutions for this system of equations after we simplify the system of equation. So, with oriented circle, we reduce the solution of circles from 8 to 2 and these two cycles tangents to 3 cycles properly.
In out algorithm, we need one circle only. Which one of these two circles we want? Consider Figure12(b), there is a vector from the center of C
1,0 to C
2,0, we find two circles tangent to C
1,0, C
2,0 and C. These two circles are on the opposite side of this vector. One is the C
2,1, which is on the left side of this vector, show in
Figure 12(b), the other one is on the right side of this vector (show in
Figure 13). The circle we want is always is on the left side of vector from C
1,0, to C
2,i. Note that in the very beginning, C
1,0 and C
2,0 oriented clockwise and C oriented counter-clock, as shown in
Figure 13, so we find C
2,1 which is oriented counter-clockwise. At this point, we need to change the oriented of C
2,1 from counter-clockwise to clockwise (change the value r
2,1 from positive to negative), and try to find C
2,2 using C
1,0, C
2,1 and R.
Example: Consider the case that n=7, m=2,3,4,5,6,7, r
1,0 =0.76642, and r
2,j , j=0,1..m-1, are shown in
Table 2. Its associated chart is shown in
Figure 14(a)-(f).