Professional Documents
Culture Documents
Rangel Mondragon Inversion 1
Rangel Mondragon Inversion 1
■ Introduction
The author of [1] describes the technique of inversion as a “dark art.” A suitable interpre-
tation of this description is offered by [2] as “an advanced technique, which can offer
considerable advantage in solving certain problems.” This article examines the basic prop-
erties of inversive geometry, starting from the introduction of involutions and the family
of generalized circles, the inversion of segments, arcs, triangles, and quadrilaterals with
applications to Nicomachus’s theorem, the inversion of tilings made by regular polygons,
and an inversive spirograph. This work extends and complements the material in [3, 4, 5].
■ Involutions
A transformation T that is not the identity with the property that T(T(z)) = z is called an in-
volution (or an involutory transformation, self-inverse, or of period two). Familiar exam-
ples of involutions are multiplication by -−1 and taking a reciprocal in arithmetic, taking a
complement in set theory, taking the conjugate of a complex number (i.e., x + i y = x -− i y,
if x and y are real), geometrical reflection in a line, the matrix transpose and matrix in-
verse, and the mapping of a number x into a -− x, with a an arbitrary number.
PermutationCycles[{5, 2, 3, 4, 1, 7, 6}]
ParallelTable[
Length[Select[Permutations[Range[n]],
PermutationOrder[#] ⩵ 2 &]], {n, 8}]
These numbers can also be readily obtained by solving a recurrence equation [6].
Module[{n},
RecurrenceTable[
{a[1] ⩵ 0, a[2] ⩵ 1, a[n] ⩵ a[n -− 1] + (1 + a[n -− 2]) (n -− 1)},
a[n], {n, 20}]]
Consider reversion, f(z) = 1 /∕ z, an involution that maps a nonzero complex number to its
reciprocal. Let U be the unit circle given by the equation z = 1 or x2 + y2 = 1, with
z = x + y i. It is easy to see that f maps the interior of U to its exterior and vice versa; that
is, z > 1 iff f(z) < 1. Moreover, f(z) = 1 iff z = 1. Reversion maps the number
-− -−
z = x + y i into the number z z 2 , where z is the conjugate of z. Considering a complex
number as a point in the complex plane, if a point is close to the origin, its reversion is far
away, and vice versa.
Here is the reversion of a complex number.
1
ComplexExpand
x + y ⅈ
x ⅈ y
-−
x2 + y2 x2 + y2
-−
Inversion, f(z) = 1 z , is an involution similar to reversion. For inversion, 0, z and f(z) are
collinear for nonzero z. The point z = x + y i inverts to the point z /∕ z 2 .
1
ComplexExpandConjugate
x + y ⅈ
x ⅈ y
+
x2 + y2 x2 + y2
The following Manipulate compares reversion, inversion, and some similar transforma-
tions. Drag the point z; the arrow starts at z and ends at f(z) for the chosen transformation
f; the interior of U is colored blue.
Manipulate
Module
{x, y, r, q},
If[Chop[Norm[Z]] ⩵ 0, Z = {0, .001}];
{x, y} = Z;
r = Norm[Z];
q = SwitchT, 1, {x, -− y} r2 , 2, {x, y} r2 , 3,
{x, y} /∕ r, 4, x2 -− y2 , -− 2 x y r4 , 5, x2 -− y2 , 2 x y r4 ,
1 1
6, Cos ArcTan[x, y], -− Sin ArcTan[x, y] r ;
2 2
Graphics[{EdgeForm[Thick], ColorData[2, 6], Disk[],
Blue, Arrow[{Z, q}], Red, Disk[Z, .05], Disk[q, .05],
Style[{Text[TraditionalForm[z], Z, {0, -− 1.5}],
Text[TraditionalForm[f[z]], q, {-− 2, 0}]}, Black,
14]},
Axes → True, PlotRange → 3]
,
{{Z, {.5, .3}}, Locator, Appearance → None},
Row
1 z 1 1 1
1 → 1 /∕ z, 2 → , 3 → , 4 → , 5 → , 6 → ,
z z z2 z2 z
SetterBar, Spacer[20], "Drag the point z."
,
1 z 1 1
f(z) = 1 1
Drag the point z.
z z
z z2 z2 z
-−1
f (z)
-−2
-−3
A + B x + D x2 + C y + D y2
x2 + y2
Let ⊖(A, B, C, D) be the set of points that satisfy the first equation in theorem 1. This four-
parameter family includes points (for instance, when A = 1 and D = B2 + C2 ), lines (when
A = 0), circles (when A = 1), the whole plane (when A = B = C = D = 0), and the empty
set (when A = B = C = 0, D = 1).
Define a generalized circle to be a line or circle. (The function genCircle defined be-
low constructs the graphics objects to draw the line or circle.) Under inversion, the gen-
eralized circle ⊖(A, B, C, D) transforms into the generalized circle ⊖(D, B, C, A). If
A = 0, (and A, B are not simultaneously 0), then ⊖(A, B, C, D) is a line. If A ≠ 0, the equa-
tion A(x2 + y2 ) + B x + C y + D = 0 corresponds to a circle with center -−(B, C) /∕ (2 A) and
radius B2 + C2 -− 4 A D 2 A , provided that B2 + C2 ≥ 4 A D. If D = 0, ⊖(A, B, C, D)
passes through the origin. For any nonzero k, ⊖(A, B, C, D) is the same as
⊖(k A, k B, k C, k D).
Other families of polynomials in two variables that include generalized circles do
not transform their members into members of the same family; that is, they are not
closed under inversion. For instance, the six-parameter family of equations
A x2 + B y2 + C x y + D x + F y + G = 0 includes conic sections, but some invert into
quartics.
SimplifyA x2 + B y2 + C x y + D x + F y + G /∕.
x → x x2 + y2 , y → y x2 + y2
1
(x2 + y2 )2
A x2 + G x4 + C x y + F x2 y + B y2 + 2 G x2 y2 + F y3 + G y4 + D x x2 + y2
Theorem 2
A line passing through different points (x1 , y1 ) and (x2 , y2 ) corresponds to the gener-
alized circle ⊖(0, y2 -−y1 , x1 -−x2 , x2 y1 -−x1 y2 ) if y1 ≠ y2 and ⊖(0, 0, 1, -−y1 ) otherwise.
The parameters needed to describe such a line are obtained by solving the following
equation.
Solve[x1 + c y1 + d ⩵ x2 + c y2 + d ⩵ 0, {c, d}]
x1 -− x2 x2 y1 -− x1 y2
c → -− , d → -−
y1 -− y2 y1 -− y2
Theorem 3
A circle with center (α, β) and radius ρ corresponds to the generalized circle
⊖(1, -−2 α, -−2 β, α2 +β2 -−ρ2 ).
This result is readily obtained by expanding the Cartesian equation of such a circle.
x2 + y2 -− 2 x α + α2 -− 2 y β + β2 ⩵ ρ2
Hence ρ2 + 1 = d2 ; that is, the origin, center, and either of the two intersection points of
the circle and the unit circle U form a right triangle; hence the circle is orthogonal to U.
This condition turns out to be necessary and sufficient for a generalized circle to be pre-
served. Theorem 1 implies the following results, which also apply conversely.
1. Any circle not passing through the origin inverts into a circle not passing through
the origin (in fact passing through its intersection points with the unit circle U, if
any).
2. Any circle passing through the origin inverts into a line not passing through the ori-
gin (in fact passing through its intersection points with U, if any; in general, this
line is parallel to the tangent of the circle at the origin).
3. Any line passing through the origin is preserved by inversion (any point is mapped
into its negative).
4. Any line not passing through the origin inverts into a circle passing through the ori-
gin (and its intersection points with U, if any).
To make inversion continuous, define the inversion of the origin to be a legal point, the
“point at infinite,” ∞, making the phrase “nonzero” unnecessary when talking about inver-
sion. Inversion is thus a one-to-one map of the extended plane.
Conversions of generalized circles to and from graphics primitives are handled by the fol-
lowing functions.
genCircle[{}] = {};
toGenC[{}] = {};
invert[{}] = {};
For example, the following Manipulate shows how a line and a circle behave under in-
version. To vary their positions, drag the two small disks. For a line, the disks are points
on the line; for a circle, one disk is the center and the other is on the circumference. You
can also choose a family of parallel lines or a family of concentric circles. The arrows
show the action of the inversion on the two control points.
Manipulate
Module
{p, q, u, v, w, i, o1, o2},
{p, q} = pq;
If[Chop[Det[pq]] ⩵ 0, p = p + {0, .01};
q = q + {.01, 0}];
{u, v} = {p -− 100 Normalize[q -− p], p + 100 Normalize[q -− p]};
w = {{0, -− 1}, {1, 0}}.Normalize[v -− u];
o1 = Switch[op, 1, {Line[{u, v}]}, 2,
{Circle[p, Norm[p -− q]]}, 3,
Table[Line[{u + i w, v + i w}], {i, -− 6, 6, .5}], 4,
Table[Circle[p, i Norm[p -− q]], {i, .2, 6, .2}]];
o2 = Map[genCircle[invert[toGenC[#]]] &, o1];
Graphics
EdgeForm[Thick], ColorData[2, 6], Disk[], Red, o1,
Blue, o2, Disk[#, .05] & /∕@ {p, q}, Black,
Ifarrows, Arrowp, p Norm[p]2 ,
Arrowq, q Norm[q]2 , {},
Axes → (op < 3), PlotRange → 3
,
{{pq, {{2, 1}, {-− 2, 2}}}, Locator, Appearance → None},
Row[{
Control @ {{op, 1, ""}, {1 → " line ", 2 → " circle ",
3 → " parallel lines ", 4 → " concentric circles "}},
Spacer[20],
Control @ {arrows, {True, False}}, Spacer[10],
"Drag a point."
}],
SaveDefinitions → True
-−1
-−2
-−3
Concentric circles do not invert into concentric circles, and the center of a circle does not
invert into the center of its inversion (although the two centers are collinear with the ori-
gin). The center of the inverted circle can even be outside the original circle! (This particu-
larly applies to U; its interior gets mapped into its exterior and its center gets mapped to
∞.) The next section shows how to locate the center of the inversion of a given circle.
As a circle is a particular kind of ellipse, it is interesting to see the inversion of a general
ellipse. The following Manipulate shows such an inversion; you can drag the center of
the ellipse with a locator and vary the lengths of its axes with a pair of sliders. Contour
lines showing concentric ellipses are optional; increase the zoom slider if the display is all
one color.
Manipulate
Module
{cx, cy},
{cx, cy} = c;
ShowGraphics[{EdgeForm[Thick], ColorData[2, 6],
Disk[{0, 0}, 1], Opacity[.5], ColorData[2, 5],
Disk[c, {a, b}]}, PlotRange → z],
Ifcl,
(-− cx + x)2 (-− cy + y)2
Ifcl1 ⩵ 1, ContourPlot + ,
a2 b2
{x, -− 8, 8}, {y, -− 8, 8}, Contours → 10,
x 2 y 2
-− cx + -− cy +
x2 +y2 x2 +y2
ContourPlot + , {x, -− 8, 8},
a2 b2
{y, -− 8, 8}
,
x 2 y 2
-− cx + -− cy +
x2 +y2 x2 +y2
ContourPlot + ⩵ 1,
a2 b2
{x, -− 8, 8}, {y, -− 8, 8}
,
"Drag the locator.",
{{a, 1, "horizontal axis"}, .1, 4, Appearance → "Labeled"},
{{b, .6, "vertical axis"}, .1, 4, Appearance → "Labeled"},
{{c, {-− .1, 0}}, Locator},
Dynamic @
Row[
{Control[{{cl, False, "contour lines"}, {True, False}}],
If[cl,
Control[{{cl1, 1, ""},
{1 → "family", 2 → "family inverted"}}], ""]}],
{{z, 4, "zoom"}, 2, 8, Appearance → "Labeled"},
SaveDefinitions → True
horizontal axis 1
contour lines
zoom 4
ρ2
invZ[{γ_, ρ_}, z_] := γ + Conjugate
z -− γ
The explicit Cartesian coordinates for inverting points come from expanding the follow-
ing expression.
x ρ2 γx ρ2
γx + -− +
(x -− γx)2 + (-− y + γy)2 (x -− γx)2 + (-− y + γy)2
y ρ2 γy ρ2
ⅈ γy + -−
(x -− γx)2 + (-− y + γy)2 (x -− γx)2 + (-− y + γy)2
Then, operating with Cartesian coordinates, the function inver inverts a given point p in
M = ⊙(γ, ρ).
For example, the functions give matching results when applied to corresponding representa-
tions of the same point in the plane. The latter form is more convenient here.
5 7 ⅈ
+
2 2
5 7
,
2 2
Abs[xx_]2 → xx2 , (px -− γx)2 + (py -− γy)2 > 0 (ρ > 0)
ρ2
Therefore, define the point q as the inverse of p if q is that unique point such that its dis-
tance to γ times the distance of p to γ is ρ2 [7].
Before obtaining the Cartesian coordinates corresponding to inverting circles and lines,
first consider the following problem. What is the center of the circle through three differ-
ent noncollinear points a, b, c?
The function disSq computes the square of the distance between two given points h, k
and is used by the function cir3 that computes the required center.
For example, here is an explicit formula for the center of such a circle through
a = (x1 , y1 ), b = (x2 , y2 ), and c = (x3 , y3 ).
simplifiedcenter =
Simplifycir3[{x1, y1}, {x2, y2}, {x3, y3}] /∕.
Abs[xx_]2 → xx2
1
(x1 -− x2)2 + (y1 -− y2)2
2
(x1 -− x3)2 + (y1 -− y3)2 (x2 -− x3)2 + (y2 -− y3)2
(x3 (-− y1 + y2) + x2 (y1 -− y3) + x1 (-− y2 + y3))2
The denominators of the expressions for the center and radius contain a factor that is zero
only when a, b, and c are collinear.
rule2 = {a → {x1, y1}, b → {x2, y2}, c → {x3, y3}};
Det[{c -− a, b -− a} /∕. rule2]
x2 y1 -− x3 y1 -− x1 y2 + x3 y2 + x1 y3 -− x2 y3
Now consider an arbitrary circle V that does not pass through the center γ of M. Invert γ
in V to γ' and then invert γ' in M to γ''. Then the inversion of V in M is a circle with cen-
ter γ''. The equality of the following two results verifies this property.
rule3 = {γ → {γx, γy}, M → {{γx, γy}, ρ}, V → {{vx, vy}, vr}};
FullSimplify[inver[M, inver[V, γ]] /∕. rule3]
(vx -− γx) ρ2
γx + ,
-− vr2 + (vx -− γx)2 + (vy -− γy)2
(vy -− γy) ρ2
γy +
-− vr2 + (vx -− γx)2 + (vy -− γy)2
(vx -− γx) ρ2
γx + ,
-− vr2 + (vx -− γx)2 + (vy -− γy)2
(vy -− γy) ρ2
γy +
-− vr2 + (vx -− γx)2 + (vy -− γy)2
Theorem 4
If the circle V = ⊙( c, σ) inverts in M = ⊙( γ, ρ) into the circle W, then the center of
W is γ +(c -−γ) ρ2 /∕( c -−γ 2 -−σ2 ) and its radius is σ ρ2 /∕ c -−γ 2 -−σ2 .
The vertical bars in the last expression have two different meanings: the modulus of a vec-
tor and the absolute value of a number. Theorem 4 arises from using the property men-
tioned in the previous paragraph. First we obtain the square of the radius of W.
rule5 = {γ → {γx, γy}, M → {{γx, γy}, ρ}, c → {cx, cy},
V → {{cx, cy}, σ}};
FullSimplify
disSq[inver[M, inver[V, γ]], inver[M, {cx + σ, cy}]] /∕.
rule5 /∕. Abs[xx_]2 → xx2
ρ4 σ 2
2
(cx -− γx)2 + (cy -− γy)2 -− σ2
So a circle V = ⊙(c, σ) is inverted into a concentric circle if c is outside the circle of inver-
sion M = ⊙(γ, ρ) and c -− γ = σ2 + γ2 . This implies that M and V are orthogonal. There-
fore, a circle inverts into a concentric circle (and necessarily of the same radius, i.e. itself)
iff it is orthogonal to M. To visualize these ideas, consider the following Manipulate
that inverts a pattern of tangent circles.
Manipulate[
Module[
{g, i, j},
g=
Join[Flatten[Table[{{i, j} -− (n + 1) /∕ 2, .5}, {i, n},
{j, n}], 1],
Flatten[Table[{{i, j} -− (n + 1) /∕ 2 + .5 {1, 1}, .2071},
{i, n -− 1}, {j, n -− 1}], 1]];
Graphics[{EdgeForm[Thick], Opacity[.5], ColorData[2, 6],
Disk[γ, ρ], ColorData[5, 7],
If[io, Map[(invCir[{γ, ρ}, #] /∕. Circle → Disk) &, g], {}],
Black, If[go, Circle @@ # & /∕@ g, {}]}, PlotRange → z,
ImagePadding → 1]
],
Row[{"Drag the locator.", Spacer[50],
Control @ {{n, 4, "complexity"}, Range[10], Setter}}],
{{ρ, .5, "radius of circle of inversion"}, 0, 5, Slider},
Row[{
Control[{{go, True, "grid"}, {True, False}}],
Spacer[3],
Control[{{io, True, "inversion"}, {True, False}}],
Spacer[4], Control[{{z, 2, "zoom"}, .01, 6, Slider}]
}],
{{γ, {0, 0}}, Locator},
SaveDefinitions → True]
The following Manipulate applies the function seg3 to any three noncollinear points,
optionally passing through one of them.
Manipulate[
Module[{a, b, c, ce},
{a, b, c} = abc;
If[Chop[Det[{b -− a, c -− a}]] ⩵ 0,
{a, b, c} = abc = abc + RandomReal[{-− .01, .01}, {3, 2}]];
ce = cir3N[a, b, c];
Graphics[{Thick, {Dotted, Circle[ce, Norm[ce -− a]]},
seg3[a, b, c, ox ⩵ 1], Red,
EdgeForm[Thin], Disk[a, .03], Disk[c, .03],
Text[Style["⨯", Bold, 30], b]}, PlotRange → 1]
],
{{abc, {{-− .2, -− .8}, {.5, -− .2}, {-− .1, .4}}}, Locator,
Appearance → None},
Row[
{Control @ {{ox, 1, "passing over x?"},
{1 → " yes ", 2 → " no "}}, Spacer[30],
"Drag a red point."}],
SaveDefinitions → True]
⨯
Let the inversion of the point h be h' and the point k be k'. There are four cases for the in-
version of the finite line segment h k in the circle M = ⊙(γ, ρ).
1. If h = k, the segment is a point and inverts into the point h' = k'.
2. If h ≠ k and h = γ, the segment h k inverts into a ray starting at k', going away
from q.
3. If h, k, and q are collinear, there are two subcases:
a. If q is in between h and k, the inverse is the union of two rays, one starting at
h', the other starting at k', and both going away from γ.
b. Otherwise, h and k are on the same side of γ, and the inverse of h k is a line seg-
ment joining h' and k' on the same side of γ as h and k, but now switched
around.
4. If h and k are not collinear with γ, consider the circle passing through γ, h', and
k'. The inversion of h k is the arc joining h' and k' that does not pass through γ.
Similar results apply to the inversion of an arc. The following Manipulate shows all
these cases as they apply to line segments and arcs. The initial segments or arcs are shown
in red and their inversions in blue. Control locators are drawn in red. When a segment/arc
is such that its corresponding line/circle passes through γ, say that it does so directly if γ
is part of the segment/arc and indirectly otherwise.
Manipulate[
Module[{M = {{0, 0}, 1}, h, k, i, u, v},
{h, k, i} = hki;
(*⋆ h, k, i and {0, 0} must be all different *⋆)
If[Length[Union[Chop /∕@ {h, k, i, {0, 0}}]] < 4,
hki = {h, k, i} = {h, k, i} + RandomReal[{-− .01, .01}, {3, 2}]
];
{u, v} = {inver[M, h], inver[M, k]};
Graphics[{EdgeForm[Black], ColorData[2, 6], Disk[],
Thick, Black,
Switch[cases,
1, {Style[Text["both ends equal", {0, -− 2.8}, {0, 0}],
15], Arrow[{h, u}], di[h, 1], di[u, 2]},
2, {
Style[Text["an end on the center of inversion",
{0, -− 2.8}, {0, 0}], 15],
If[
segArcs ⩵ 1,
{li[{h, {0, 0}}, 1], li[{u, u + 100 Normalize[u]}, 2],
di[u, 2]},
{Red, seg3[{0, 0}, h, k, True], di[k, 1],
li[{u + 100 Normalize[u -− v], v}, 2]}
],
di[h, 1]
},
3, {
Style[
Text["directly covering the center of inversion",
{0, -− 2.7}, {0, 0}], 15],
If[
segArcs ⩵ 1,
{
k = -− Abs[k.Normalize[h]] Normalize[h];
v = inver[M, k];
li[{h, k}, 1],
li[{u, u + 100 Normalize[u]}, 2],
li[{v, v + 100 Normalize[v]}, 2]
},
{
Red, seg3[h, {0, 0}, k, True],
li[{u, u + 100 Normalize[u -− v]}, 2],
invAll[M_, p_] :=
Quiet @ Map[invSeg[M, #] &, Partition[p, 2, 1, 1]]
The function invSeg is used to invert a general triangle and a general quadrilateral. As
mentioned before, the inversion of a polygon is a figure made by adjoining arcs of circles
that pass through q. (The geometry of coincident arcs is the same as the geometry of poly-
gons. Just invert them!) However, the interior of a polygon does not invert to the interior
of its inverse. The function fill fills this interior for aesthetics.
fill[{
Circle[c1_, r1_, {α1_, β1_}],
Circle[c2_, r2_, {α2_, β2_}],
Circle[c3_, r3_, {α3_, β3_}]
}] :=
Module[{t, t1, t2, t3, t4, mi, d1, d2, d3, d4},
t1 = Table[c1 + r1 {Cos[t], Sin[t]},
{t, α1, β1, .01 (β1 -− α1)}];
t2 = Table[c2 + r2 {Cos[t], Sin[t]},
{t, α2, β2, .01 (β2 -− α2)}];
t3 = Table[c3 + r3 {Cos[t], Sin[t]},
{t, α3, β3, .01 (β3 -− α3)}];
{d1, d2, d3, d4} =
Norm /∕@ {Last[t1] -− First[t2], Last[t1] -− Last[t2],
Last[t1] -− First[t3], Last[t1] -− Last[t3]};
mi = Min[d1, d2, d3, d4];
t4 = Join[t1, Which[mi ⩵ d1, t2, mi ⩵ d2, Reverse[t2],
mi == d3, t3, True, Reverse[t3]]];
If[(mi ⩵ d3) (mi ⩵ d4), t3 = t2];
{d1, d2} =
Norm /∕@ {Last[t4] -− First[t3], Last[t4] -− Last[t3]};
mi = Min[d1, d2];
Polygon[Join[t4, Which[mi ⩵ d1, t3, True, Reverse[t3]]]]
]
fill[
{
Circle[c1_, r1_, {α1_, β1_}],
Circle[c2_, r2_, {α2_, β2_}],
Circle[c3_, r3_, {α3_, β3_}],
Circle[c4_, r4_, {α4_, β4_}]}] :=
Module[{t, t1, t2, t3, t4, t5, t6, mi, d1, d2, d3, d4,
d5, d6},
t1 = Table[c1 + r1 {Cos[t], Sin[t]},
{t, α1, β1, .01 (β1 -− α1)}];
t2 = Table[c2 + r2 {Cos[t], Sin[t]},
{t, α2, β2, .01 (β2 -− α2)}];
t3 = Table[c3 + r3 {Cos[t], Sin[t]},
{t, α3, β3, .01 (β3 -− α3)}];
t4 = Table[c4 + r4 {Cos[t], Sin[t]},
{t, α4, β4, .01 (β4 -− α4)}];
{d1, d2, d3, d4, d5, d6} =
Norm /∕@ {Last[t1] -− First[t2], Last[t1] -− Last[t2],
Last[t1] -− First[t3], Last[t1] -− Last[t3],
Last[t1] -− First[t4], Last[t1] -− Last[t4]};
mi = Min[d1, d2, d3, d4, d5, d6];
t5 = Join[t1,
Which[
mi ⩵ d1, t2,
mi ⩵ d2, Reverse[t2],
mi == d3, t3,
mi ⩵ d4, Reverse[t3],
mi ⩵ d5, t4,
True, Reverse[t4]
]
];
If[(mi ⩵ d3) (mi ⩵ d4), t3 = t2];
If[(mi ⩵ d5) (mi ⩵ d6), t4 = t2];
{d1, d2, d3, d4} =
Norm /∕@ {Last[t5] -− First[t3], Last[t5] -− Last[t3],
Last[t5] -− First[t4], Last[t5] -− Last[t4]};
mi = Min[d1, d2, d3, d4];
t6 = Join[t5, Which[mi ⩵ d1, t3, mi ⩵ d2, Reverse[t3],
mi == d3, t4, True, Reverse[t4]]];
If[(mi ⩵ d3) (mi ⩵ d4), t4 = t3];
{d1, d2} =
Norm /∕@ {Last[t6] -− First[t4], Last[t6] -− Last[t4]};
mi = Min[d1, d2];
Polygon[Join[t6, Which[mi ⩵ d1, t4, True, Reverse[t4]]]]
]
triangle quadrilateral
Module[{b, n = 7},
Graphics[{EdgeForm[Thin], White,
Table[
b = i (i -− 1) /∕ 2;
{
Rectangle[{b, 0}, {b + i, i /∕ 2}],
Table[Rectangle[{b, i /∕ 2 + i j}, {b + i, i /∕ 2 + i (j + 1)}],
{j, 0, i /∕ 2 -− 1}],
Rectangle[{0, b}, {i /∕ 2, b + i}],
Table[Rectangle[{i /∕ 2 + i j, b}, {i /∕ 2 + i (j + 1), b + i}],
{j, 0, i /∕ 2 -− 2}]
}, {i, 2, n, 2}
],
Table[b = i (i -− 1) /∕ 2;
{
Table[Rectangle[{b, i j}, {b + i, i j + i}], {j, 0, i /∕ 2}],
Table[Rectangle[{i j, b}, {i j + i, b + i}],
{j, 0, i /∕ 2 -− 1}]}, {i, 1, n, 2}
]
}]
]
Module[{b, n = 7},
Graphics[{EdgeForm[Thin], White,
Table[b = i (i -− 1) /∕ 2;
{
Rectangle[{b, -− i /∕ 2}, {b + i, i /∕ 2}],
Table[Rectangle[{b, i /∕ 2 + i j}, {b + i, i /∕ 2 + i (j + 1)}],
{j, 0, i /∕ 2 -− 1}],
Rectangle[{-− i /∕ 2, b}, {i /∕ 2, b + i}],
Table[Rectangle[{i /∕ 2 + i j, b}, {i /∕ 2 + i (j + 1), b + i}],
{j, 0, i /∕ 2 -− 2}]
},
{i, 2, n, 2}],
Table[b = i (i -− 1) /∕ 2;
{
Table[Rectangle[{b, i j}, {b + i, i j + i}], {j, 0, i /∕ 2}],
Table[Rectangle[{i j, b}, {i j + i, b + i}],
{j, 0, i /∕ 2 -− 1}]
}, {i, 1, n, 2}]
}]
]
Add replicas around the lower-left vertex of the unit square made by rotating this pattern
90, 180, and 270 degrees to obtain a symmetrical pattern. Then eliminate repeated
squares; moreover, eliminate repeated segments from adjacent squares using filter.
filter = {
{x___, {a : {ax_, ay_}, {bx_, ay_}}, y___,
{{bx_, ay_}, c : {cx_, ay_}}, z___} ⧴ {x, {a, c}, y, z},
{x___, {{bx_, ay_}, c : {cx_, ay_}}, y___,
{a : {ax_, ay_}, {bx_, ay_}}, z___} ⧴ {x, {a, c}, y, z},
{x___, {a : {ax_, ay_}, b : {bx_, ay_}}, y___,
{{cx_, ay_}, {dx_, ay_}}, z___} ⧴
{x, {a, b}, y, z} /∕; ax ≤ cx ≤ dx ≤ bx
};
The function nichoSegs computes the segments needed to form the next pattern shown,
which gives a visual proof of Nicomachus’s theorem [9].
nichoSegs[n_] :=
Module[{m = {{0, -− 1}, {1, 0}}, g, h, a, b, ax, ay, bx,
by, h2, xx, yy, u},
g={
Table[b = i (i -− 1) /∕ 2;
{
Rectangle[{b, -− i /∕ 2}, {b + i, i /∕ 2}],
Table[Rectangle[{b, i /∕ 2 + i j}, {b + i, i /∕ 2 + i (j + 1)}],
{j, 0, i /∕ 2 -− 1}],
Rectangle[{-− i /∕ 2, b}, {i /∕ 2, b + i}],
Table[Rectangle[{i /∕ 2 + i j, b}, {i /∕ 2 + i (j + 1), b + i}],
{j, 0, i /∕ 2 -− 2}]
},
{i, 2, n, 2}],
Table[b = i (i -− 1) /∕ 2;
{
Table[Rectangle[{b, i j}, {b + i, i j + i}],
{j, 0, i /∕ 2}],
Table[Rectangle[{i j, b}, {i j + i, b + i}],
{j, 0, i /∕ 2 -− 1}]
},
{i, 1, n, 2}]
};
h = Union[
Flatten[{
g,
g /∕. Rectangle[a_, b_] ⧴ Rectangle[m.a, m.b],
g /∕. Rectangle[a_, b_] ⧴ Rectangle[m.m.a, m.m.b],
g /∕. Rectangle[a_, b_] ⧴ Rectangle[m.m.m.a, m.m.m.b]
}] /∕. Rectangle[{ax_, ay_}, {bx_, by_}] ⧴
Rectangle[{Min[ax, bx], Min[ay, by]},
{Max[ax, bx], Max[ay, by]}]
];
h2 = Union[Flatten[h /∕. Rectangle[{ax_, ay_}, {bx_, by_}] ⧴
{
{{ax, ay}, {bx, ay}},
,
The function nichoSegs computes the minimum number of segments necessary to pro-
duce the pattern. This is the number of segments up to n = 10.
{6, 10, 18, 30, 46, 66, 90, 118, 150, 186}
The nth pattern has 2 (n2 -− n + 3) segments and 2 n(n + 1) squares. Not removing unneces-
sary segments would give 8 n(n + 1) segments, so for large n, removing unnecessary seg-
ments is more than four times better. The following Manipulate shows Nicomachus’s
pattern in gray along with its inversion in red. You can change M and thus q by dragging
the locator, and you can vary r with the slider.
Manipulate[
Module[{nico, iA},
nico = nichoSegs[n];
If[io, iA = Map[invSeg[{c, r}, #] &, nico]];
Graphics[{EdgeForm[Thick],
If[ic, {Opacity[.5], ColorData[2, 6], Disk[c, r]}, {}],
Gray, If[go, Line /∕@ nico, {}], Red, Thick,
If[io, iA, {}]}, PlotRange → z]
],
{{c, {0, 0}}, Locator},
Row[{"Drag the locator.", Spacer[40],
Control @ {{n, 2, "squares on the side"}, Range[7],
Setter}}],
{{r, 1.3, "radius of circle of inversion"}, .01, 5,
Slider, Appearance → "Labeled"},
Row[{
Control[{{go, True, "show grid"}, {True, False}}],
Spacer[3],
Control[{{io, True, "show its inversion"},
{True, False}}], Spacer[3],
Control[{{ic, True, "show circle of inversion"},
{True, False}}]
}],
{{z, 2, "zoom"}, .01, 15, Slider, Appearance → "Labeled"},
SaveDefinitions → True]
zoom 2
expand3[{x_, y_}] :=
Modules = 3 , {{x + 2, y}, {x + 1, y + s}, {x -− 1, y + s},
ring3[n_] :=
Union @ Flatten[NestList[Flatten[Join[expand3 /∕@ #], 1] &,
{{0, 0}}, n], 1]
The corresponding functions inv3, inv4, and inv6 invert each of the segments form-
ing the tiling. For instance, here is the pattern for the triangular case.
Although the interiors of triangles are not preserved by inversion, they are filled to show
the interference patterns they produce. The idea is shown in the next figure; to avoid clut-
ter, only the first four members of ring3[1] are drawn. Lines join the vertices of the tri-
angles to their inversions.
With[{u = Take[ring3[1], 4], s = (s /∕. rule6), M = M /∕. rule6},
Graphics[{EdgeForm[Thin], Orange, Opacity[.5],
Map[Polygon[{#, # + {2, 0}, # + {1, s}}] &, u], Pink,
fill /∕@ Map[inv3[M, #] &, u], Black, Circle @@ M,
Map[
{Line[{#, inver[M, #]}],
Line[{# + {2, 0}, inver[M, # + {2, 0}]}],
Line[{# + {1, s}, inver[M, # + {1, s}]}]} &, u]}
]
]
Although the triangles do not overlap, the interiors of their inverses do. In fact, the inver-
sion of the central triangle contains the interiors of all the rest. The next level of complex-
ity renders the following pattern.
Similarly, in the case of tiling with squares, here are the corresponding functions.
expand4[{x_, y_}] := {
{x + 1, y},
{x + 1, y + 1},
{x, y + 1},
{x -− 1, y + 1},
{x -− 1, y},
{x -− 1, y -− 1},
{x, y -− 1},
{x + 1, y -− 1}
}
ring4[n_] :=
Union @ Flatten[NestList[Flatten[Join[expand4 /∕@ #], 1] &,
{{0, 0}}, n], 1]
Here is a detail corresponding to the first four squares of the arrangement ring4[1].
And here is a detail of the sixth level. (The color assignment has to be made explicit and
does not rely only on overlapping as it did before.)
The tiling using regular hexagons cannot be colored with two colors, and there are too
many segments to place the center of M. So here is a line pattern.
ring6[n_] :=
Union @ Flatten[NestList[Flatten[Join[expand6 /∕@ #], 1] &,
{{0, 0}}, n], 1]
The second level of complexity corresponding to the above pattern is the following.
This detail shows the sixth level of complexity, made with shapes formed with six arcs, all
passing indirectly through q.
■ An Inversive Spirograph
Finally, the following Manipulate shows an animated circle (orange) rotating inside a
circle (pale brown) and the patterns generated by a point at the end of a line at a variable
distance from the center of the circle. By varying the center and radius of the inversive cir-
cle, you can zoom in; the rotating radial line inverts into an arc orthogonal to the inversive
path. You can enlarge the inversion by dragging the center of the inversive circle (light
blue).
invCir[{q_, r_}, {Ac_, Ar_}] :=
Modulen = disSq[Ac, q] -− Ar2 ,
Diskq + (Ac -− q) r2 n, Ar r2 Abs[n]
Manipulate[
Module[{M, cen, u},
cen = (1 -− a) {Cos[t], Sin[t]};
M = {q, r};
Show[
Graphics[{EdgeForm[Thin], Opacity[.5],
If[w ≠ 2,
{ColorData[2, 5], Disk[], ColorData[2, 3],
Disk[cen, a], {Opacity[1], Black,
Line[{cen, u = cen + arm {Cos[t /∕ a], -− Sin[t /∕ a]}}],
Disk[u, .04]}},
{}
],
If[w > 1,
{ColorData[2, 6], Disk[q, r], Red, Disk[q, .05],
ColorData[2, 5], invCir[M, {{0, 0}, 1}],
invCir[M, {cen, a}], Black,
{Opacity[1],
invSeg[M,
{cen, cen + arm {Cos[t /∕ a], -− Sin[t /∕ a]}}]}},
{}
]}, PlotRange → 3],
If[w ≠ 2,
ParametricPlot[(1 -− a) {Cos[u], Sin[u]} +
arm {Cos[u /∕ a], -− Sin[u /∕ a]}, {u, 0, n π},
PlotPoints → 100],
{}
],
Quiet @ If[w > 1,
ParametricPlot[
inver[M, (1 -− a) {Cos[u], Sin[u]} +
arm {Cos[u /∕ a], -− Sin[u /∕ a]}], {u, 0, n π},
PlotPoints → 300],
{}
]
]
],
{{a, 0.5, "radius of rotating circle"}, 0, 1,
Appearance → "Labeled"},
{{arm, 0.5, "length of rotating arm"}, .01, 2,
Appearance → "Labeled"},
{{q, {1, 2}}, Locator, Appearance → None},
Row[
{Control @ {{r, 1, "radius of inversive circle"}, .01,
3, Appearance → "Labeled", ImageSize → Small},
Spacer[5], "Drag the red point."}],
{{n, 3, "number of turns"}, Range[10], Setter}, Delimiter,
{{w, 3, ""}, {1 → " spirograph only ",
2 → " inversion only ", 3 → " both "}},
{{t, 0, "rotate"}, 0, n π, Appearance → "Labeled"},
SaveDefinitions → True]
number of turns 1 2 3 4 5 6 7 8 9 10
rotate 0
■ References
[1] G. Smith, A Mathematical Olympiad Primer, London: United Kingdom Mathematics Trust,
2008.
[2] A. Goucher. “Complex Projective 4-Space.” (Jun 24, 2013). cp4space.wordpress.-
com/2012/11/04/final-chapter-of-moda.
[3] J. Rangel-Mondragon, “Inversive Patterns, Part I: Complex Inversion,” Mathematica in Ed-
ucation and Research, 12(2), 2007 pp. 162–183.
[4] J. Rangel-Mondragon, “Inversive Patterns, Part II: Fundamental Properties of Inversion,”
Mathematica in Education and Research, 12(4), 2007 pp. 330–354.
[5] J. Rangel-Mondragon, “Inversive Patterns, Part III: Common Tangents, Mandalas and Gothic
Windows,” Mathematica in Education and Research, 12(4), 2007 pp. 355–376.
[6] N. J. A. Sloane. seq. A001189 in The On-Line Encyclopedia of Integer Sequences. oeis.org.
[7] H. S. M. Coxeter and S. L. Greitzer, Geometry Revisited, New York: Random House, 1967.
[8] E. W. Weisstein. “Nicomachus’s Theorem” from Wolfram MathWorld—A Wolfram Web Re-
source. mathworld.wolfram.com/NicomachussTheorem.html.
[9] M Schreiber. “A Visual Proof of Nicomachus’s Theorem” from the Wolfram Demonstrations
Project—A Wolfram Web Resource.
demonstrations.wolfram.com/AVisualProofOfNicomachussTheorem.
Jaime Rangel-Mondragon received M.Sc. and Ph.D. degrees in applied mathematics and
computation from the School of Mathematics and Computer Science at the University
College of North Wales in Bangor, UK. He has been a visiting scholar at Wolfram
Research, Inc. and has held positions in the Faculty of Informatics at UCNW, the Center
for Linguistic and Literary Studies at the College of Mexico, the Department of Electrical
Engineering at the Center for Research and Advanced Studies at the National Polytechnic
Institute, the Center for Computational Engineering (of which he was director) at the
Monterrey Institute of Technology, the Department of Mechatronics at the Queretaro
Institute of Technology, and the Autonomous University of Queretaro in Mexico, where
he is presently a member of the Faculty of Informatics and in charge of the academic unit
of Algorithms, Computation, and Networks. His current research includes combinatorics,
the theory of computing, computational geometry, and recreational mathematics.
Jaime Rangel-Mondragon
Autonomous University of Queretaro
Queretaro, Qro. Mexico
[email protected]