Abstract
Malfatti’s problem is the problem of fitting three circles into a triangle such that they are tangent to each other and each circle is also tangent to a pair of the triangle’s sides. This problem has been extended to include Tn = 1 + 2 + … + n circles inside the triangle with special tangency properties among the circles and triangle sides; this problem is referred to as the extended Malfatti problem or the Tri(Tn) problem. In the extended Malfatti problem, the number of circles in the triangle is a triangle number because the tangency properties between the internal circles and the three sides of the triangle have a special type of structure; that is, the corner circle is tangent to two sides of the triangle and two other circles, the boundary circles are tangent to one side of the triangle and four other circles, and the inner circles are always tangent to six other circles. The circles we find in the extended Malfatti problem have the following property: the smallest and largest radii of the circles differ to a great extent. In the study presented herein, we propose algorithms to solve the problem that the tangency properties between the circles and the sides of the triangle are not fixed, so that the number of circles in the triangle is not necessarily a triangle number. The purpose of this change is to attempt to establish the radii of the circles in the triangle within a small range.
Keywords:
Malfatti’s problem; geometric constraint solver; computer-aided geometric design; circle packing MSC:
52C15
1. Introduction
Before we explain the problem in detail, we will introduce related materials such as the extended Malfatti problem.
1.1. Malfatti’s Problem and the Extended General Malfatti Problem
The circles-in-an-area problem has been investigated for a number of years. Circles may comprise equal circles or circles of different radii. The area can be a triangle [1,2,3,4], square [5], circle [6], or other area [7].
In 1803, Gian Francesco Malfatti [8] proposed the following problem: how to find the maximum total volume of three cylindrical columns out of a triangular prism of marble.
Identically, the problem can be recognized as finding three circles that fit into a specific triangle and ensuring that the total area is at its maximum. Malfatti theorized that the solution was to make three circles tangent to each other and to make each circle tangent to two sides of the triangle. One case is shown in Figure 1 [9].
Figure 1.
Malfatti’s problem.
In fact, Malfatti’s hypothesis is incorrect. In 1930, Lob and Richmond [10] established a method to obtain a larger area of some triangles by using a greedy algorithm that inscribes a single circle of the maximal radius within the triangle; inscribes a second circle within one of the three remaining corners of the triangle—the one with the smallest angle; and inscribes a third circle within the largest of the five remaining areas. The difference in area for an equilateral triangle is roughly over 1% (as shown in Figure 2) [11]; however, as Howard Eves (1946) stated, for an isosceles triangle with a very sharp apex, the optimal solution has nearly twice the area of the Malfatti circles (as shown in Figure 3) [12]. As stated in the 1960s, later proven firmly, the Lob–Richmond procedure always gives the largest area and solves the problem. In the literature, Malfatti’s hypothesis has become understood as Malfatti’s problem [13,14,15].
Figure 2.
Circles in an equilateral triangle.
Figure 3.
Malfatti’s problem and the max area problem.
There are several known solutions to Malfatti’s problem. In their work, Fukagawa and Pedoe [15] state that Chokuen Ajima actually formulated and solved Malfatti′s problem. For a detailed history of the problem and explanations of various solutions and generalizations, interested readers are referred to [16,17,18].
The extended Malfatti problem [19] aims to determine Tn circles that can be inscribed inside a triangle while maintaining tangency among the circles and the triangle’s sides. When considering the problem with Tn = circles, it is referred to as the Tri(Tn) n problem (as shown in Figure 4). Notably, when n = 1, the problem seeks to find the inscribed circle of a triangle, and when n = 2, it is precisely Malfatti’s problem.
Figure 4.
The tangency property of the Tri(Tn) problem.
There are closed forms for finding inscribed circles and Malfatti’s circles. Therefore, when n = 1 or n = 2, it is easy to propose a constant time algorithm to solve these problems. Chiang [19] proposed algorithms to solve the Tri(Tn) problem when n > 2.
There are three types of circles—corner circles, edge circles, and inner circles. Corner circles are tangent to two other circles and two sides of the triangle (Figure 5a). Edge circles are tangent to four other circles and one side of the triangle (Figure 5b). Inner circles are tangent to six other circles. Let SA(C) represent the sum of the surrounding angles for circle C. Then, SA(C) is the sum of 4, 5, and 6 angles, as shown in Figure 5a, Figure 5b, and Figure 5c, respectively. Specifically, if C is a corner circle, then SA(C) = α1 + α2 + α3 + α4, as depicted in Figure 5a. The definition of SA(C) is similar when C is an edge circle or an inner circle.
Figure 5.
Calculation of the total surrounding angles for 3 types of circles. (a) Corner Circle; (b) Edge Circle; (c) Inner Circle.
Chiang proposed an algorithm [19] that requested three vertices of the triangle and a value n as the inputs. From these inputs, we know the triangle (from three vertices), number of circles (from n), and the tangency relation between the circles and the sides of the triangle (from n). However, we do not know the radii of the circles. The initial radii are given for all circles and since then, the algorithm adjusts the radii so that SA(C) is equal to 2π for all circles, C. Chiang uses the following approach to adjust the radii: If SA(C) is greater than 2π, the radius of C should be enlarged. If SA(C) is less than 2π, the radius of C should be reduced. This approach is repeated until SA(C) is equal to 2π for all circles, C [19]. There are different methods to compute SA(C) when C is a corner circle, an edge circle [19], or an inner circle [20].
When considering the Tri(T2) problem, only corner circles are involved in this problem (see Figure 1). Assuming that these three circles have radii r1, r2, and r3, when we multiply these radii by a constant k, the angle computation (in Figure 5a) for α1, α2, α3, and α4 shows the same result. This means that there are infinitely many solutions in this case. One more constraint is required to find one solution only. The constant k can be computed by comparing the length of one side of the triangle with the corresponding side of the triangle bounded by these three circles, as shown in Figure 6. The constant k is referred to as the change ratio for the current solution and the real solution.
Figure 6.
Tri(T2) problem; change ratio = c/c′.
The Algorithm 1 proposed by Chiang [19] is as follows:
| Algorithm 1. Chiang’s Algorithm |
|
The result for the Tri(Tn) problem, n = 2, 3, 4, 8, 30, using Chiang’s algorithm [19] is shown in Figure 7.
Figure 7.
Tri(Tn) problem, where n = 2, 3, 4, 8, and 30.
1.2. Problem Statement
We would like to take the main concept of Chiang’s algorithm and propose a new algorithm to ensure that the radii of these circles have a small range. Based on the results shown in Figure 7, the smallest angle of a triangle corresponds to the biggest circle. Conversely, the largest angle corresponds to the smallest circle, especially for the acute angle. In the circle packing area, some problems fix the radius of the circles inside the specified area or at least in similar-sized circles. Therefore, we propose a new algorithm based on the concept of Chiang’s algorithm to ensure that the circle’s radii have a small range. In Chiang’s algorithm, because the structure of circles inside the triangle is fixed, it is not necessary to establish a tangency graph (explained in further detail below) before finding the solution.
Circle packing inside a triangle can be applied to some applications, such as wireless transmitter location design. The centers of the circles are the position of the transmitter locations and the radii are the distance the transmitter can transmit. If the radii of the circles vary, different types of transmitters with different transmission distances are needed. Therefore, our aim is for the radius range of these circles to be small. The same concept can be applied in radar location design so that nothing can pass this triangle area. Other applications include logo design and circle-cutting design to reduce material wastage. There is an intermediate process needed to create a triangle mesh; therefore, many applications of mesh can also be treated in the same manner as the application in this paper. We will give an example at the end of this paper.
This paper comprises four sections. In Section 1, Malfatti’s problem is illustrated and extended. In Section 2, some terms, derived theories, and proposed algorithms for the new problem are defined. In Section 3, details of algorithm implementation are described. In Section 4, conclusions are drawn.
2. Terms, Theories, and Algorithms
Our aim is to find circles inside a triangle, where there are specified tangency constraints between these circles and the three sides of the triangle. We use a tangency graph to show the tangency constraints. Consider a graph G (V, E), where V corresponds to the vertices that represent the circles or the sides of the triangles and E represents the edges connecting the vertices. When an edge connects two vertices, this means that these two geometric objects are tangent to each other. That is, the circle is externally tangent to the circle if these two geometric objects are circles or if the circle is tangent to the side of the triangle. When a circle is tangent to two, one, or zero sides of a triangle, we refer to it as a corner circle, edge circle, or inner circle, respectively.
We use Tri(T2) and its tangency graph G(V, E) as an example (see Figure 8a), where V = {c1, c2, c3, e1, e2, e3} and E = {(c1, c2), (c1, c3), (c2, c3), (c1, e2), (c1, e3), (c2, e1), (c2, e3), (c3, e1), (c3, e2)}, as shown in Figure 8b. To see the edge circle or corner circle tangent to the side of the triangle more clearly, we drew a tangency graph, as shown in Figure 8c.
Figure 8.
Tri(T2) problem and its tangency graphs. (a) Tri(T2) problem; (b) Tangency graph; (c) Our tangency graph.
The main concept of the new proposed algorithm is to generate a tangency graph, to find solution radii for all circles that satisfy the constraints specified by the tangency graph, and then to display them. The purpose of this algorithm is to find circles with a small range of radii. At the start of the process, it is necessary to set a real number r, with the aim of generating circles inside the triangle that have a radius near r. Our proposed algorithm comprises four parts, including data inputting, the generation of a tangency graph, the use of Chiang’s algorithm, and result generation.
Thus, the main concept of the proposed Algorithm 2 is as follows:
| Algorithm 2. Proposed Algorithm |
|
Steps one and two are the inputs of the algorithm; steps three, four, five, and six generate the tangency graph of this problem; and step seven involves the use of Chiang’s algorithm to find the solution for the tangency graph. The final step involves displaying the results.
We will describe the above algorithm in more detail, including the solution to the following four problems:
- How to find the R-offset of a triangle (step 3, 4.1).
- How to construct the tangency graph (vertices and edges) for the same layer.
- How to construct the tangency (vertices and edges) for two consecutive layers.
- How to stop the while loop in step 4.
2.1. Offset a Triangle
Consider three different terms—line, ray, and line segment. There is no endpoint for a line, one endpoint for a ray, and two endpoints for a line segment. Consider the parametric forms of a line, ray, and line segment passing through two points, P1 and P2; these parametric forms are the same (1 − t) P1 + tP2 with different parameter ranges. There is a line, ray, and line segment when t∈R, t ≥ 0, and 0 ≤ t ≤ 1, respectively. Note that the ray has P1 as its endpoint, denoted as Ray(P1, P2); with the orientation of Ray(P1, P2), we can define the left side and the right side of Ray(P1, P2). Let L = Ray(P1, P2); we denote the point P1′ as the point moving P1 to the left side of the Ray(P1, P2) R distance, and we denote P1′ = Move(P1, L, R). Ray(P1′, P2′), also denoted as Rayr(P1, P2), is referred to as the R-offset of Ray(P1,P2).
Before providing a detailed description of the proposed algorithm, we present the following theorem:
Theorem 1.
R-offset of a ray. Given Rayr (P1, P2), where P1 = (x1, y1) and P2 = (x2, y2), the parametric form of Rayr(P1, P2) is (1 − t)P1 + tP2 + r × nL, , where nL = (, ). The implicit form for the line cover Rayr(P1, P2) is a′x + b′y + c′ = 0, where a′ = (y2 − y1), b′ = (x1 − x2), and c′ = .
Proof of Theorem 1.
The direction of the ray is P2 − P1 = . The two vectors nL = and nR = are perpendicular to P2-P1. These two vectors point to the left (nL) and the right (nR). We can move points on Ray(P1, P2) along the nL direction R distance; therefore, the parametric form for Rayr (P1, P2) is (1 − t) P1 + tP2 + R × nL. Consider two points, P1′ and P2′, which are points P1 and P2, moving to left side of Ray(P1, P2); that is, Pi′ = (xi′,yi′) = Pi + R × nL, I = 1, 2. The implicit form for Ray(P1, P2) is ax + by + c = 0, where a = y2 − y1, b = x1 − x2, and c = . Let the R-offset of Ray(P1, P2) be denoted as Rayr(P1, P2) = a′x + b′y + c′ = 0, where a′ = y2′ − y1′ = a, b′ = x1′ − x2′ = b, and c′ = = . Thus, the implicit form of Rayr(P1, P2) is (y2 − y1)x + (x1 − x2)y − + = 0. □
Example 1.
Given two points, P1 = (1, 1) and P2 = (5, 2), let L = Ray1 (P1, P2). The points P1′ = Move(P1, L, 1) = (0.757, 1.970), and P2′ = Move(P2, L, 1) = (4.757, 2.970). In Figure 9, L is shown in blue with implicit form x + 4y + 3 = 0. Furthermore, Ray1(P1,P2) = Ray(P1′, P2′) is shown in orange with implicit form x + 4y + 7.123 = 0. So, Ray1(P1, P2) is the 1-offset of the ray from P1 to P2, and Ray(P1′, P2′) is the ray from P1′ to P2′; they are the same ray because P1′ and P2′ are the points that move P1, P2 to the left side of the ray from P1 to P2 for a distance equal to one.
Figure 9.
R-offset of a ray.
We refer to Ray(P1′, P2′) as the R-offset of Ray(P1, P2).
The following theorem is taken directly from [21].
Theorem 2.
Intersection of two lines from four points [11]. Given four points, P1 (x1, y1), P2 (x2, y2), P3 (x3, y3), and P4 (x4, y4), there are two lines, L1 and L2, where L1 passes through P1, P2, and L2 passes through P3, P4. Then, if , L1, L2 are parallel to each other. Otherwise, these two lines intersect each other at (x,y), where
Theorem 3.
Intersection of two R-offset rays from three points. Given Ray(P1, P2) and Ray(P2, P3), where Pi = (xi,yi) and I = 1, 2, 3, the intersection of Rayr(P1, P2) and Rayr(P2, P3) is (x, y) = () if ≠ 0, where
Proof of Theorem 3.
Let L1 = Ray(P1, P2), L2 = Ray(P2, P3), L3 = Rayr(P1, P2), and L4 = Rayr(P2, P3). Let P1′ = Move(P1, L1, r), P2′ = Move(P2, L1, r), P3′ = Move(P2, L2, r), and P4′ = Move(P3, L2, r); then, P1′ = P1 + r × n12, P2′ = P2 + r × n12, P3′ = P2 + r × n23, and P4′ = P3 + r × n23, where n12 = and n23 = (,. The proof can be easily derived using Theorem 2 with the following four points—P1′, P2′, P3′, and P4′. □
The intersection P(x, y) = () when .
Example 2.
Given three points, P1 = (1, 1), P2 = (10, 2), and P3 = (3, 5), P1′ = (0.889, 1.993), P2′ = (9.889, 2.993), P3′ = (9.606, 1.080), and P4′ = (2.606, 4.080). The intersection point P for Ray1(P1, P2) and Ray1(P2, P3) is at (6.119, 2.575), as shown in Figure 10.
Figure 10.
Intersection of two R-offset rays from three points.
We denote P = Ray1(P1, P2) ∩ Ray1(P2, P3).
From △ABC, we can find three points—B′ = Rayr(A,B) ∩ Rayr(B,C), C′ = Rayr(B,C) ∩ Rayr(C,A), and A′ = Rayr(C,A) ∩ Rayr(A,B). △A′B′C′ is referred to as the R-offset triangle for △ABC.
Example 3.
Given A = (1, 1), B = (10, 2), and C = (3, 5), the 1-offset triangle for ΔABC is a triangle with vertices A′ = (2.716, 2.196), B′ = (6.119,2.575), and C′ = (3.472, 3.709); see Figure 11.
Figure 11.
The result of the R-offset triangle.
2.2. How to Construct Vertices and Edges on the Same Layer
The primary purpose of the proposed algorithm is to generate the tangency graph G (V, E) to ensure that circles in the triangle have a small range of radii. Thus, it was necessary to generate the vertices, as well as the edges that connect the vertices. We generated the vertices layer by layer and generated the edges for the same layer, as well as the edges that connect two consecutive layers. Given a triangle △ABC and circles with radius r, where r is much smaller than the shortest length of three sides of the triangle, and given that △A′B′C′ is the R-offset of △ABC, then the circles centered at the sides of △A′B′C′ with radius r are tangent to △ABC. At this stage, our aim is to find the vertices on edge A’B’ (steps one to three in the following description) and △A′B′C′ (steps four and five). Furthermore, the edges of these two consecutive layers, △ABC and △A′B′C′, must be generated (step six).
- Find n circles with radius r’, where r’ is close to r, so that these circles can be lined up tangent to two circles on the vertices A’ and B’ with radius r, as shown in Figure 12. That is, find integer n and r′ so that |r − r′| is at a minimum and 2(r + n ∗ r′) is equal to the length of A′B′.
Figure 12. Vertex setup for one side of the triangle. (a) Add three vertices; (b) Find vertices in between one side. - All centers of the circles shown in Figure 12b are the vertices belonging to V.
- Connect two consecutive vertices in Figure 12b belonging to E.
- It is also necessary to carry out these four steps for B’C’ and C’A’ to generate more vertices and edges for the graph G(V,E).
- Connect two neighbors of the vertices of △A′B′C′.
- Connect edges from to , from to and from to (described in Section 2.3)
Using the above approach, starting from △ABC, the 1-offset of △ABC is T1 (△A′B′C′); the vertices and edges for T1 are shown in Figure 13a. Note that the three vertices of triangle T1 have a circle center at these three vertices with radius r tangent to △ABC.
Figure 13.
Generating the tangency tree for triangles. (a) ΔABC to T1; (b) T1 to T2; (c) T2 to T3; (d) T3 to T4; (e) Tlast contains 1 vertex; (f) Tlast contains 3 vertices.
Next, consider triangle T2, which is the R-offset of T1. The method used for generating vertices and edges for T2 is identical to the method used to generate vertices and edges for T1. Thereafter, we generate edges between vertices in T1 and vertices in T2 (which will be described in the following section), with the tangency graph shown in Figure 13b.
2.3. How to Construct Edges on Two Consecutive Layers
The next step in the process involves generating edges between the vertices on T1 and the vertices on T2. Before we explain our strategy to connect the vertices on these two triangles, we present the following theorem.
Theorem 4.
Find the foot point of a point onto a line. Given a point g (x3, y3) and a line L (g∉L) passing through two points, (x1, y1) and (x2, y2), the nearest point, also called the foot point, of g onto L is at , as shown in Figure 14.
Figure 14.
Establishment of the foot point f of point g.
Proof of Theorem 4.
With a point (x,y) on L, we can generate the square of the distance function from (x,y) to point g, as follows: f(t) = = . We aim to find the value t at which f(x) is the minimum; that is, . The parameter value t can be computed from □
Consider the correspondence edge on T1 and on T2. Assume the parameter values for the vertices on are t0, t1, …, tm, and the parameter values for the foot points of vertices on onto are t0′, t1′, …, tn′. We explain the details with m = 7 and n = 3, as shown in Figure 15. To simplify our description, we use the parameter values as the vertex name hereafter. The vertices t0 and t7 are the vertices on ; at this point, no vertices on (T2) are connected. When we construct edges for △A′B′C′, we construct one edge from t1 to the last vertex on and from t6 to the first vertex on . Next, it was necessary to construct the edges for ti, I = 1…, 6 and tj′, j = 0, 3. We used the following approach to connect edges between vertices generated on T1 and T2. Note that we tried to connect vertices in to the vertices close to it in . We employed the same process for vertices in to the vertices close to it in , as well as for vertices in to the vertices close to it in .
Figure 15.
Relation between vertices.
We define the floor and ceiling for the vertices as follows:
where. With the above definition, we connect vertices to all vertices from = 0, …, n. Therefore, in Figure 15, connects vertices from = t1 to = t2, and connects vertices from = t4 to = t6. Therefore, the vertex with parameter has three edges connected to the vertices on .
The results following the connection of the edges between T1 and T2 are shown in Figure 13b. We continued to generate vertices on T3 = R-offset(T2) and T4 = R-offset(T3) and generated vertices and edges for the tangency graph G(V,E). We increased the number of vertices on V and the number of edges connecting vertices on the same layer and previous layer; see Figure 13c,d. At this point, it is appropriate to determine how to stop the process.
2.4. How to Stop the While Loop
It is already established that any triangle contains an inscribed circle and three Malfatti circles. The criterion to stop the algorithm depends on the radius of the inscribed circle and the minimum radius of the three Malfatti circles.
This process specifies the tangency properties between circles, representing vertices on G(V,E). Let r1 be the radius of the inscribed circle for Tlast, and let r2 be the minimum radius of the three Malfatti circles for Tlast. If one of these two radii is less than (1 + epsR)r—eqpR —a small value set by us—we stop the process and leave the loop. If r1 is close to r, we use one vertex for Tlast (see Figure 13e; otherwise, we use three vertices for Tlast (see Figure 13f)). The final aspect involved in constructing a tangency graph is connecting the edges for the vertices of Tlast with the previous layer triangle (see Figure 13e,f).
3. Examples
We used “Intel® Core™”i7-10750H CPU, 16G Ram, and Anaconda 23.5.2 (https://www.anaconda.com/products/distribution, accessed on 28 August 2024) with Python 3.11.3 (https://www.python.org) to implement the algorithm. We provide two examples below.
Example 4.
Given a triangle with vertices at A = (10, 10), B = (100, 20), and C = (30, 50) and initial r = 2, set epsR = 0.3 and eps = 0.0001; the tangency graph these values generate is shown in Figure 13a–e. Following angle computation for every circle, including corner circles, boundary, and inner circles, a figure is produced, as shown in Figure 16. It takes 144.9, 6.140, and 0.288 s to construct a tangency graph, to find the radii for all circles, and to display the results, respectively. All of the circles generated have the radii range (0.829, 4.129), which is (0.415r, 2.065r).
Figure 16.
Output display for Example 4.
In this case, on the final layer, the radius of the inscribed circle is 2.22, which is less than (1 + epsR)r = 2.6, and the radii of the Malfatti circles are 1.432, 1.099, and 1.766, with the minimum radius being 1.099. The value 2.22 is closer to r = 2 compared to 1.099. Thus, the final generated layer contains one vertex only. The output is shown in Figure 16.
Note that there are four circles in Figure 16 that contain larger inner circles. We found that when a circle has a large number of surrounding circles, there is a high likelihood that its radius is large. Therefore, if we add more circles in close proximity, this raises the question as to whether it is possible to reduce the range of the radii for the problem. Thus, after constructing the tangency graph, we checked the degree of each vertex; if the degree is larger than 15 or between 12 and 15, we construct two vertices/circles or one new vertex/circle with this vertex. Next, we use two different algorithms—one is used before adjustment and the other is used after adjustment. For the latter, we present the following example.
Example 5.
Given a triangle with vertices at A = (10, 10), B = (100, 20), and C = (30, 30) and initial r = 1.9, set epsR = 0.3 and eps = 0.0001. The tangency graph before the adjustment constructs is shown in Figure 17a, and its associated tangency circles in the triangle are shown in Figure 17b. Note that two vertices contain more than 15 vertices; in this case, we add two more vertices for each of these two vertices, as shown in Figure 17c; their associated tangency circles in the triangle are shown in Figure 17d. Note that the range of the radii shown in Figure 17d is smaller than the range of the radii shown in Figure 17b.
Figure 17.
Before and after the adjustment in Example 5. (a) Tangency graph before adjustment; (b) Result for the tangency graph in (a); (c) Tangency graph after adjustment; (d) Result for the tangency graph in (c).
We can see the clear difference between Figure 17b,d. Herein, we would like to compare the range of the radii with numerical numbers. There are 66 circles in Figure 17b; thus, we compared our results with Chiang’s result to solve the Tri(T11) problem because T11 = 65, which is close to 66. The result for Tri(figureT11) using Chiang’s algorithm is shown in Figure 18.
Figure 18.
The solution for Tri(T11).
A comparison of the range of the radii using three different algorithms is shown in Table 1. The first algorithm is Chiang’s algorithm to solve the Tri(T11) problem. The second and third algorithms are the proposed algorithm before and after adjustment before using Chiang’s algorithm, respectively. We refer to these as Algorithm 1 and Algorithm 2. Shown are the minimum, lower quartile, median, third quartile, and maximum values of the circle radii from these three algorithms. We also show the range of the radii in the final column. Note that from Tri(T11) to Algorithm 1, the radius for the smallest circle varies from 0.147 to 0.52, and the median varies from 1.397 to 0.945. However, the maximum values vary from 5.28 to 5.684. At this point, we found that the large circle has more neighboring circles, which is the reason as to why we added one adjustment before using Chiang’s algorithm. Below, we compare Chiang’s algorithm with Algorithm 2, where the range of the radii (max–min) drops to 3.8 from 5.133.
Table 1.
Comparison of the radii from the three different algorithms.
Example 6.
Given a triangle with vertices at A = (0, 0), B = (37.5, 64.952), and C = (75, 0), set r = 2, epsR = 0.4, and eps = 0.0001; the tangency graph these values generate is similar to the previous example, except for the final step, as shown in Figure 13f. The resulting figure following angle computation for every circle, including corner circles, boundary circles, and inner circles, is shown in Figure 19. It takes 127.106, 1.430, and 0.130 s to construct a tangency graph, to find the radii for all circles, and to display the results, respectively. All of the circles generated have the radii range (1.506, 2.194), which is (0.753r, 1.097r).
Figure 19.
Output for Example 6.
In this case, on the final layer, the radius of the inscribed circle is 4.330, and the minimum radius of the Malfatti circles is 2.745. Because 4.330 > 2.8 and 2.745 < 2.8, the final generated layer has three vertices, and we connected these three vertices to the vertices in the previous layer triangle. The output is shown in Figure 17.
Note that Figure 17a,c generate the triangle mesh. This meshed triangle can be used in games to enable NPCs (non-player characters) to navigate through a triangle without walking directly from A on one side of the triangle to a point B on the other side. We can find a path from point at T0 to T1, then T1 to T2, up until Tlast. When there is more than one choice, we select any one because we did not ask for the shortest path. Using this approach, we can find a path for a robot from A to Tlast, and a path from B to Tlast. Connecting these two paths, it generates a path from A to B. Using this approach and the tangency graph shown in Figure 17c, the path from A to B is shown in Figure 20.
Figure 20.
Non straigt path for robots from A to B.
4. Conclusions and Future Research
Herein, we propose an algorithm to generate a tangency graph to specify the tangency relationship among all circles and triangle boundaries. The purpose of this proposed algorithm is to reduce the range of the radii among all circles. The process of generating a tangency graph takes more CPU time compared to the time spent constructing and displaying circles.
There are some ways to extend the research presented herein. For example, we can extend the problem from a triangular area to a circular triangle (including the Reuleaux triangle) or the area bounded by three Bezier curves. Another direction of future research could be to change the area from a triangle to a convex polygon.
Author Contributions
Conceptualization, C.-S.C.; methodology, C.-S.C.; software, Y.-T.C.; writing—original draft, C.-S.C.; writing—review and editing, Y.-T.C.; funding acquisition, C.-S.C. All authors have read and agreed to the published version of the manuscript.
Funding
This research is supported by grant NSTC-112-221-E-031-003.
Data Availability Statement
The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.
Acknowledgments
We extend our heartfelt gratitude to Guan Wen Wang and Hsi Wen Wang for their invaluable contributions to the programming aspect of this research.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Eckard, S. The Best Known Packings of Equal Circles in an Isosceles Right Triangle. 11 March 2011. Available online: http://hydra.nat.uni-magdeburg.de/packing/crt/crt.html (accessed on 1 May 2011).
- Melissen, H. Densest packings of congruent circles in an equilateral triangle. Am. Math. Mon. 1993, 100, 916–925. [Google Scholar] [CrossRef]
- Melissen, J.; Schuur, P. Packing 16, 17 or 18 circles in an equilateral triangle. Discret. Math. 1995, 145, 333–342. [Google Scholar] [CrossRef][Green Version]
- Graham, R.L.; Lubachevsky, B.D. Dense packings of equal disks in an equilateral triangle: From 22 to 34 and beyond. Electron. J. Comb. 1995, 2, 1. [Google Scholar]
- Eckard, S. The Best Known Packings of Equal Circles in a Square. 20 May 2010. Available online: http://hydra.nat.uni-magdeburg.de/packing/csq/csq.html (accessed on 25 May 2010).
- Friedman, E. “Circles in Circles”, Erich’s Packing Center. Available online: https://erich-friedman.github.io/packing/cirincir/ (accessed on 20 May 2024).
- Melissen, J.B.M. Packing and Covering with Circles. Ph.D. Thesis, Utrecht University, Utrecht, The Netherlands, 1997. [Google Scholar]
- Malfatti, G. Memoria sopra un problema stereotomico. Mem. Mat. Fis. Soc. Ital. Sci. 1803, 10, 235–244. [Google Scholar]
- Chiang, C.S.; Hoffmann, C.M.; Rosen, P. A gereralized Malfatti’s Problem. Comput. Geom. 2012, 45, 425–435. [Google Scholar] [CrossRef]
- Lob, H.; Richmond, H.W. On the Solutions of Malfatti’s Problem for a Triangle. Proc. Lond. Math. Soc. 1930, 2, 287–304. [Google Scholar] [CrossRef]
- Eves, H. Malfatti Problem (problem 4145). Probl.Solut. Am. Math. Mon. 1946, 53, 285–286. [Google Scholar] [CrossRef]
- Wells, D. Malfatti’s problem. In The Penguin Dictionary of Curious and Interesting Geometry; Penguin Books: New York, NY, USA, 1991; pp. 145–146. ISBN 978-0-14-011813-1. [Google Scholar]
- Stanley, O.C. Malfatti’s problem In Excursions in Geometry; Dover: Mineola, NY, USA, 1990; pp. 145–147. ISBN 978-0-486-26530-8. [Google Scholar]
- Goldberg, M. On the Original Malfatti Problem. Math. Mag. 1967, 40, 241–247. [Google Scholar] [CrossRef]
- Fukagawa, H.; Pedoe, D. The Malfatti Problem. In Japanese Temple Geometry Problems (San Gaku); The Charles Babbage Research Centre: Winnipeg, MB, Canada, 1989; pp. 28, 103–106. [Google Scholar]
- Bottema, O. The Malfatti Problem. Forum Geom. 2000, 1, 43–50. [Google Scholar]
- Stefanović, M. Triangle centers associated with the Malfatti circles. Forum Geom. 2003, 3, 83–93. [Google Scholar]
- Wolfram Math World. Malfatti Circles. Available online: http://mathworld.wolfram.com/MalfattiCircles.html (accessed on 20 May 2024).
- Chiang, C.-S.; Li, H.C.; Hsiung, M.-H.; Chiu, F.-M. Extended General Malfatti’s Problem. In Proceedings of the 19th International Conference on Scientific Computing, Las Vegas, NV, USA, 26–29 July 2021. [Google Scholar]
- Collins, C.R.; Stephenson, K. A circle packing algorithm. Comput. Geom. 2003, 25, 233–256. [Google Scholar] [CrossRef]
- Weisstein, E.W.; Line-Line Intersection. From MathWorld—A Wolfram Web Resource. Available online: https://mathworld.wolfram.com/Line-LineIntersection.html (accessed on 20 May 2024).
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).