#
Algorithm for Generating the *Flower of Life* Pattern

## Section 2. A Generalized Algorithm.

While section 1 of
this article concentrated on specific algorithms for the first few
rotations, we will now move toward generalizing these algorithms. We
will define as *intersects* all the outermost points
(with respect to the center of the first circle) where two or more
circles intersect. These are all the points, where two or more
circles intersect, that are most distant from the center of the first
circle. We will define radius *r _{m}* and

*r*to be the distance from the center of the first circle to these intersect points. A

*unit circle*is defined as a circle with the same radius as the first circle, that is, a radius equal to

*1*. All subsequent circles are drawn with this radius. The locations of unit circles are computed in polar coordinates with the center of the first circle taken as the origin. First we will look at odd numbered rotations, followed by even numbered rotations.

### 2.1 Odd Numbered Rotations

First note that all odd numbered rotations follow the same pattern. Six
circles are always drawn at the same angular coordinates as in the
previous, odd rotation. Only the radius *r*, the distance from
the center of the first circle, changes for each rotation. Looking at
figure 2.1, each pair of adjacent, red colored line segments defines an
equilateral triangle. Hence, rotating around the pattern, each intersect
point occurs at a *π/3* angular increment from the previous
intersect point. By induction, each intersect point is located a distance
*r = (n + 1)/2* from the origin, where *n*
is the number of the rotation. With this information we have enough to
define the following algorithm.

Figure 2.1 - 3rd rotation

*γ ← π/2**r ← (n + 1)/2*- draw unit circle centered at
*(r, γ)* *γ ← γ + π/3*- repeat steps 3 and 4 a total of
*five*more times

### 2.2 Even Numbered Rotations

We divide even numbered rotations into two cases. First, we consider
even numbered rotations that have an *even* number of intersects
in any given sector. A sector is defined as a sequence of intersects,
a unit distance apart, that are mutually co-linear with each other.
Second, we consider even numbered rotations that have an *odd*
number of intersects in any given sector.

#### Case 1. An Even Number of Intersects.

Looking at figure 2.2, note that the number of intersects per sector
equals *n/2*, where *n* is the rotation number. By symmetry,
we need only consider the intersects above line segment *b*. The
line segments *b*, *h _{m}*, and

*r*form a right triangle. By induction, the line segment

_{m}*b*has a length of

*√3(n/4 + ½)*, and the height

*h*equals

_{m}*(m + ½)*, where

*m*equals

*0, … , (n/4 - 1)*. Therefore, the angle

*φ*equals

_{m}*arctan[h*, and by the Pythagorean Theorem, the radius

_{m }/ b]*r*equals

_{m}*(b*. With this information we have enough to define the following algorithm.

^{2}+ h_{m}^{2})^{1/2}Figure 2.2 - 4th rotation

*γ ← 0**b ← √3(n/4 + ½)**m ← 0*- if
*m ≥ n/4*go to step 12 *h*_{m}← (m + ½)*φ*_{m}← tan^{-1}[h_{m}/ b]*r*_{m}← (b^{2}+ h_{m}^{2})^{1/2}- draw unit circle centered at
*(r*_{m}, γ + φ_{m}) - draw unit circle centered at
*(r*_{m}, γ - φ_{m}) *m ← m + 1*- go to step 4
*γ ← γ + π/3*- repeat steps 3 through 12 a total of
*five*more times

### Case 2. An Odd Number of Intersects.

Looking at figure 2.3, note once again that the number of intersects per
sector equals *n/2*, where *n* is the number of the rotation.
By symmetry, we need only consider the single intersect at the end of
line segment *b*, as well as the intersects above *b*. The
line segments *b*, *h _{m}*, and

*r*form a right triangle. By induction, the line segment

_{m}*b*has a length of

*√3(n + 2)/4*, and the height

*h*equals

_{m}*m*, where

*m*equals

*0, … , (n - 2)/4*. Therefore, the angle

*φ*equals

_{m}*arctan[h*, and by the Pythagorean Theorem, the radius

_{m}/ b]*r*equals

_{m}*(b*. With this information we have enough to define the following algorithm.

^{2}+ h_{m}2)^{1/2}Figure 2.3 - 6th rotation

*γ ← 0**b ← √3(n + 2)/4*- draw unit circle centered at
*(b, γ)* *m ← 1*- if
*m > (n - 2)/4*go to step 13 *h*_{m}← m*φ*_{m}← tan^{-1}[h_{m}/ b]*r*_{m}← (b^{2}+ h_{m}^{2 })^{1/2}- draw unit circle centered at
*(r*_{m}, γ + φ_{m}) - draw unit circle centered at
*(r*_{m}, γ - φ_{m}) *m ← m + 1*- go to step 5
*γ ← γ + π/3*- repeat steps 3 through 13 a total of
*five*more times