# Prototyping Vehicle Control Applications
Using the CAT Vehicle Simulator

Rahul Bhadani111Vanderbilt University<EMAIL_ADDRESS><EMAIL_ADDRESS>
Jonathan Sprinkle222Vanderbilt University<EMAIL_ADDRESS>
###### Abstract

This paper demonstrates the integration model-based design approaches for
vehicle control, with validation in a freely available open-source simulator.
Continued interest in autonomous vehicles and their deployment is driven by
the potential benefits of their use. However, it can be challenging to
transition new theoretical approaches into unknown simulation environments.
Thus, it is critical for experts from other fields, whose insights may be
necessary to continue to advance autonomy, to be able to create control
applications with the potential to transition to practice. In this article, we
will explain how to use the CAT Vehicle simulator and ROS packages to create
and test vehicle controllers. The methodology of developing the control system
in this article takes the approach of model-based design using Simulink, and
the ROS Toolbox, followed by code generation to create a standalone C++ ROS
node. Such ROS nodes can be integrated through roslaunch in the CAT Vehicle
ROS package.

##  1 Introduction

Recent advances in computing, control, and sensor technology have brought
autonomous systems – especially autonomous ground vehicles (AV) into the
limelight of not only academic research but also media [16]. The goal of
autonomous vehicle control and related research is to improve passenger
comfort and safety [6, 10] and reduce road accidents[9]. At the same time,
some other researchers have been investigating the use of autonomous vehicle
control in reducing traffic congestion [4, 14, 1, 3] and fuel consumption
reduction [8, 11]. Such objectives and research endeavors encompass a mix of
simulation study as well as experimental research using physical platforms.
While there are several simulation software and packages have been developed
to prototype autonomous vehicle control – both general-purpose simulators such
as AirSim [13], CARLA [5]; and application-specific simulators such as CAT
Vehicle [2], and [15], not all simulators are created equally. Some provide
the ability to prototype a wide variety of use cases but at the same arduous
and difficult to get familiar with, while others are limited in use cases but
easier to understand.

In this article, we present ways in which a previously proposed autonomous
vehicle simulator CAT Vehicle, written as a ROS package [12] can be used to
prototype longitudinal vehicle control. The CAT Vehicle simulator is a multi-
vehicle simulator that uses rigid body dynamics from the Gazebo physics engine
[7]. The methodology presented in this article takes the approach of model-
based design using Mathworks’ Simulink. Simulink provides ROS Toolbox that can
be used to prototype ROS components along with custom control law. Further,
Simulink allows code-generation of C++ standalone ROS node provides open-
source C++ code, capable of executing on any Ubuntu machine.

The rest of the article is divided into the following parts. Section 2
provides a step-by-step guide to installing the CAT Vehicle ROS package.
Section 3 provides a brief overview of CAT Vehicle APIs available for
controller prototype. Section 4 provides an example of vehicle control. We end
the article with a conclusion.

##  2 Installing CAT Vehicle Package

The CAT Vehicle is a ROS-based simulator written as a ROS package to
facilitate the development of autonomous vehicle control applications. The
simulator utilizes Gazebo 3D world and ROS tools for deploying and testing a
control application in a 3D environment with realistic vehicle dynamics. In
this section, we provide a hands-on on how to install the CAT Vehicle ROS
package that will help you in getting started with writing an autonomous
control application. The examples presented in this article use ROS Noetic on
Ubuntu 20.04.

###  2.1 Installing ROS Noetic

Open the terminal, and execute the following commands

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc)
main" \

> /etc/apt/sources.list.d/ros-latest.list'

sudo apt install curl # if you haven't already installed curl

curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | \

sudo apt-key add -

sudo apt-get update

sudo apt install ros-noetic-desktop-full

echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc

sudo apt install python3-rosdep python3-rosinstall \

python3-rosinstall-generator python3-wstool build-essential python3-rosdep

Once successfully executed above commands, close the terminal, reopen it, and
execute the following command

sudo rosdep init

rosdep update

In addition, we require a few additional packages that can be installed using
the following command:

sudo apt-get install python-yaml

sudo apt-get install ros-noetic-controller-manager \

ros-noetic-ros-control ros-noetic-ros-controllers \

ros-noetic-gazebo-ros-control libpcap-dev ros-noetic-velodyne

###  2.2 Creating Catkin Workspace

The first step in using the CAT Vehicle ROS package is to create a catkin
workspace. Open a Terminal in your Ubuntu machine and type the following:

cd ~

mkdir -p catvehicle_ws/src

cd catvehicle_ws/src

catkin_init_workspace

cd ..

catkin_make

Next, we will clone a few essential repositories that are dependencies for the
CAT Vehicle package

git clone https://github.com/jmscslgroup/catvehicle

git clone https://github.com/jmscslgroup/obstaclestopper

git clone https://github.com/jmscslgroup/control_toolbox

git clone https://github.com/jmscslgroup/sicktoolbox

git clone https://github.com/jmscslgroup/sicktoolbox_wrapper

git clone https://github.com/jmscslgroup/stepvel

git clone https://github.com/jmscslgroup/cmdvel2gazebo

cd catvehicle

git checkout noetic_gazebo-11

cd ~/catvehicle_ws/

catkin_make

catkin_make compiles all packages and generates two folders in ~/catvehicle_ws
with the name devel and build. They contain executables and other artifacts to
run the program written in ROS packages.

###  2.3 Sourcing Workspace to the Environment Path

We also need to tell the terminal where to find the desired program we want to
run. For that, we need to “source” the catvehicle_ws catkin workspace. We do
this by typing the following in the terminal:

echo "source ~/catvehicle_ws/devel/setup.bash" >> ~/.bashrc

source ~/.bashrc

Once done, close your terminal and reopen it. To test your installation, type
the following in one terminal

roslaunch catvehicle catvehicle_neighborhood.launch

and the following in the second terminal:

gzclient

gzclient should open a Gazebo window that should look like the one shown in
Figure 1.

Figure 1: A Gazebo window with an example simulated environment.

##  3 CAT Vehicle APIs for Vehicle Control Applications

While this section is not a tutorial on how to use ROS, it is necessary to
understand a few basic things about ROS that can help create some simple
control applications. we explain the basics using what is provided through the
CAT Vehicle package.

###  3.1 The Launch File

ROS provides a methodology to execute a specialized program called ROS nodes
through launch files. ROS nodes do some meaningful tasks (such as executing a
control law) and publish messages on a named topic or subscribe to some other
messages through a named topic. At the same time, some other ROS nodes can
subscribe to messages being published through topics. Topics are like slots
and nodes put messages on those slots – some other node can read those slots
to get messages.

Launch files have an extension .launch and they are generally in the launch
directory of a ROS package. In the case of the CAT Vehicle package, consider
the launch file catvehicle_empty.launch. It can be used to create a simulation
by typing the following in a terminal

roslaunch catvehicle catvehicle_empty.launch

To see the visual, we type the following in another terminal:

gzclient

The above command launches a window in the Gazebo program showing a virtual
world with a ground plane and the center coordinates as shown in Figure 2.

Figure 2: An empty Gazebo window.

###  3.2 Spawning a Vehicle

Spawning a vehicle in the virtual world is done using the
catvehicle_spawn.launch file in another terminal.

roslaunch catvehicle catvehicle_spawn.launch

By default, it creates a vehicle at the origin with the name catvehicle. The
launch file provides several command line arguments that can be revealed by
pressing the tab a couple of times after typing roslaunch catvehicle
catvehicle_spawn.launch in the terminal. We have the following command line
arguments:

  * •

camera_left: to enable the left camera mounted on the car.

  * •

camera_right: to enable the right camera mounted on the car.

  * •

laser_sensor: to enable front 2-D Lidar sensor.

  * •

obstaclestopper: to enable a custom control node that prevents collision.

  * •

pitch: specify the pitch in radian.

  * •

robot: the name of the car. you must specify a unique name when spawning
multiple cars in the simulation.

  * •

roll: specify the roll in radian.

  * •

triclops: enable front-mounted camera on the car.

  * •

updateRate: specify the update rate of speed of the car published.

  * •

velodyne_points: enable 3D Velodyne Lidar sensor.

  * •

X: specify the X coordinate of the car.

  * •

Y: specify the Y coordinate of the car.

  * •

yaw: specify the yaw of the car in radian.

  * •

Z: specify the Z coordinate of the car.

With some of the most essential options, we can spawn a car with the following
command-line arguments:

roslaunch catvehicle spawn.launch robot:=ego X:=0.0 laser_sensor:=true

The above command spawns a car at the center with the name ego and a front 2D
Lidar sensor enabled. Figure 3 displays the outcome.

Figure 3: A car spawned at the center with a 2-D laser sensor

###  3.3 Important ROStopics in the CAT Vehicle package

To develop a control application, we will need to know about some important
ROS topics. A full list of topics can be obtained by typing rostopic list and
anything that starts with /ego are topics associated with the above car we
spawned. /ego/vel is where we get the current driving speed of the car on its
linear.x component. Note that each topic has a message type that is equivalent
to a C++ structure. You can see the message types of each topic in the output
of the rostopic list. Interested readers can learn more about ROS messages at
http://wiki.ros.org/msg. The relative speed of any car being followed by a car
directly in its front can be found on the linear.z component of /ego/rel_vel.
It will be zero if there is no car in the front. Headway distance of the
leader car in front of the ego car is obtained on the topic /ego/lead_dist on
the data component. A control command to the car can be sent on the topic
/ego/cmd_vel where you can specify speed on the linear.x component and
steering angle on the angular.z component.

##  4 Controller Modeling Example

For controller modeling, we take the approach of model-based design using
Simulink software which is a part of Mathworks’ MATLAB. Simulink provides a
library of blocks for specific purposes. One such blocks are ROS toolbox that
can be used for creating controller models.

###  4.1 Modeling in Simulink

Open MATLAB, in the MATLAB command prompt, type simulink. Select “Create
Model” in the Blank Model option. In the empty model workspace, you can see
Library Browser where you can choose, drag-and-drop blocks to perform certain
tasks. We are interested in blocks from ROS Toolbox. Note that my example is
built in MATLAB 2022b. We are interested in a naive velocity control shown in
Equation 1 which we arbitrarily came up with. This control law is merely for
following a vehicle in its front if there is one.

$v_{\textrm{cmd}}=\begin{cases}r+0.5v_{\textrm{lead}}\quad~{}\textrm{if}~{}h>30\\\
r\quad~{}\textrm{if}~{}h=30\\\
r-0.5v_{\textrm{lead}}\quad~{}\textrm{if}~{}h<30\end{cases}$ (1)

In Equation (1), $r$ is the desired velocity for the ego vehicle (The ego
vehicle is the one we are interested in controlling). $v_{\textrm{lead}}$ is
the speed of the vehicle or an object directly in the range of the ego
vehicle’s front LiDAR sensor. $v_{\textrm{lead}}$ is reconstructed from LiDAR
data by differentiating headway $h$ (that is available on the /ego/lead_dist
topic) and adding to the ego’s current velocity $v$ (obtained from the topic
/ego/vel). Differentiated relative velocity is published on /ego/rel_veltopic.
$v_{\textrm{cmd}}$ is published on the topic /ego/cmd_vel. Note that
/ego/cmd_vel and /ego/vel are different because a vehicle has dynamics so it
won’t exactly be driving with what it is commanded to do so. We have a hidden
transfer function to represent the vehicle dynamics but we don’t model it
separately. It is done by rigid body dynamics implemented in the CAT Vehicle
package.

A full model of Equation (1) in Simulink is shown in Figure 4 where the
Equation is contained in MATLAB function block.

Figure 4: The Simulink model of the velocity controller

###  4.2 Settings for the model

In the Simulink Simulation tab, we set the stop time of the simulation to be
inf. Now, we specify ROS-related parameters in the Modeling tab -> Model
Settings to generate a ROS node. In Model Settings, we use the following
settings:

  1. 1.

Solver -> Type: Fixed Step, Fixed-Step Size: 0.05 (which is in seconds)

  2. 2.

Hardware implementation-> Hardware Board: Robot Operating System, Target
Hardware Resources-> Build Options: Build and Load, Catkin Workspace:
~/catvehicle_ws/ (or /home/<username>/catvehicle_ws/)

Then we press OK. We save the model as velocity_control.slx. The Simulink file
used in this example can be downloaded from
https://github.com/rahulbhadani/medium.com/blob/master/10-30-2022/velocity_control.slx.

###  4.3 Generating ROS node and corresponding launchfile from the Simulink
model

To generate the ROS node, we type roscore in a terminal window, and then in
the Simulink ROS tab, press Build & Load. It compiles the model and generates
a C++ standalone ROS node in ~/catvehicle_ws/src. The first step in running
the simulation is to create a launch file. We first create a new text file in
an editor and copy the following code:

<?xml version="1.0" encoding="UTF-8"?>

<launch>

<arg name="robot" default="ego"/>

<arg name="r" default="20.0"/>

<param name="/$(arg robot)/r" type="double" value="$(arg r)"/>

<group ns="ego">

<node pkg="velocity_control" type="velocity_control"

name="velocity_control_node" output="screen"/>

</group>

</launch>

We save the text file as velocity_control.launch in the launch folder of the
catvehicle package (which may be in the ~/catvehicle_ws/src/catvehicle/launch
directory).

###  4.4 Simulation Setup

We consider a two-vehicle simulation where the first vehicle or the leader
vehicle drives with an open loop trajectory specified from a data file. The
data file can be downloaded from
https://github.com/rahulbhadani/medium.com/releases/download/data/test_data.csv
The leader vehicle control is executed using velinjector.launch. For the
purpose of this tutorial, we save data in the home directory. A whole setup is
illustrated in Figure 4.

Figure 5: Two-car simulation setup for the velocity control example

###  4.5 Running the Simulation

To run the simulation with our velocity controller developed in the Simulink,
we need to execute several roslaunch files in different terminal windows. To
make things easier, we can use the bash script below which executes all
roslaunch one by one.

#!/bin/bash

gnome-terminal \-- roslaunch catvehicle catvehicle_empty.launch

sleep 5

gnome-terminal \-- roslaunch catvehicle catvehicle_spawn.launch robot:=leader
X:=30.0

sleep 5

gnome-terminal \-- gzclient

sleep 5

gnome-terminal \-- roslaunch catvehicle spawn.launch robot:=ego X:=0.0
laser_sensor:=true

sleep 5

velinjectfile="roslaunch catvehicle velinjector.launch

csvfile:=/home/ubuntu/test_data.csv input_type:=CSV

time_col:=Time vel_col:=speed robot:=leader str_angle:=0.0"

gnome-terminal \-- $velinjectfile

sleep 5

gnome-terminal \-- roslaunch catvehicle velocity_control.launch robot:=ego
r:=2.5

sleep 5

gnome-terminal \-- rosparam set /execute true

We save the above bash script as run_controller.sh and execute the following
to run the simulation

chmod +x run_controller.sh

./run_controller.sh

The above command opens a series of terminal windows and executes all commands
one by one.

To log the data in a .bag format, type rosbag record -a. The .bag file can be
analyzed using the bagpy python package. How to use the bagpy package can be
found at https://jmscslgroup.github.io/bagpy. To terminate the simulation, we
press Ctrl-C in every terminal window that was opened through the bash script.
To stop the rosbag recording, we also need to press Ctrl-C.

##  5 Conclusion and Discussion

In this article, we have discussed how to use the CAT Vehicle ROS package and
Simulink’s model-based design approach to prototype a vehicle control law and
test it in the Simulation. The example presented in this article uses local
data corresponding to the ego vehicle, however, a more complex control law
that uses non-local data is also possible. Further other sensor information
such as front and side-camera can be used for improving the decision-making
ability of the velocity control. However, based on the current implementation
of the simulator in the CAT Vehicle package, only a velocity control command
is possible. If acceleration-based control law needs to be prototyped, one
needs to take an indirect approach of adding an integrator block in Simulink
to integrate the commanded acceleration to produce a velocity command.

## References

  * [1] Rahul Bhadani, Matthew Bunting, Benjamin Seibold, Raphael Stern, Shumo Cui, Jonathan Sprinkle, Benedetto Piccoli, and Daniel B Work.  Real-time distance estimation and filtering of vehicle headways for smoothing of traffic waves.  In Proceedings of the 10th ACM/IEEE International Conference on Cyber-Physical Systems, pages 280–290, 2019.
  * [2] Rahul Bhadani, Jonathan Sprinkle, and Matthew Bunting.  The CAT Vehicle Testbed: A Simulator with Hardware in the Loop for Autonomous Vehicle Applications.  In Proceedings 2nd International Workshop on Safe Control of Autonomous Vehicles (SCAV 2018), Porto, Portugal, 10th April 2018, Electronic Proceedings in Theoretical Computer Science 269, volume 269, pages 32–47, 2018\.
  * [3] Rahul Kumar Bhadani, Benedetto Piccoli, Benjamin Seibold, Jonathan Sprinkle, and Daniel Work.  Dissipation of emergent traffic waves in stop-and-go traffic using a supervisory controller.  In 2018 IEEE Conference on Decision and Control (CDC), pages 3628–3633. IEEE, 2018.
  * [4] Maria Laura Delle Monache, Thibault Liard, Anais Rat, Raphael Stern, Rahul Bhadani, Benjamin Seibold, Jonathan Sprinkle, Daniel B Work, and Benedetto Piccoli.  Feedback control algorithms for the dissipation of traffic waves with autonomous vehicles.  In Computational Intelligence and Optimization Methods for Control Engineering, pages 275–299. Springer, 2019.
  * [5] Alexey Dosovitskiy, German Ros, Felipe Codevilla, Antonio Lopez, and Vladlen Koltun.  Carla: An open urban driving simulator.  In Conference on robot learning, pages 1–16. PMLR, 2017.
  * [6] Yuchuan Du, Chenglong Liu, and Yishun Li.  Velocity control strategies to improve automated vehicle driving comfort.  IEEE Intelligent transportation systems magazine, 10(1):8–18, 2018\.
  * [7] Nathan Koenig and Andrew Howard.  Design and use paradigms for gazebo, an open-source multi-robot simulator.  In 2004 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)(IEEE Cat. No. 04CH37566), volume 3, pages 2149–2154. IEEE, 2004.
  * [8] Nathan Lichtle, Eugene Vinitsky, George Gunter, Akash Velu, and Alexandre M Bayen.  Fuel consumption reduction of multi-lane road networks using decentralized mixed-autonomy control.  In 2021 IEEE International Intelligent Transportation Systems Conference (ITSC), pages 2068–2073. IEEE, 2021.
  * [9] Maria Michalowska and Mariusz Oglozinski.  Autonomous vehicles and road safety.  In International Conference on Transport Systems Telematics, pages 191–202. Springer, 2017.
  * [10] Navid Mohajer, Saeid Nahavandi, Hamid Abdi, and Zoran Najdovski.  Enhancing passenger comfort in autonomous vehicles through vehicle handling analysis and optimization.  IEEE Intelligent Transportation Systems Magazine, 13(3):156–173, 2020.
  * [11] Yanyan Qin, Hao Wang, and Bin Ran.  Stability analysis of connected and automated vehicles to reduce fuel consumption and emissions.  Journal of Transportation Engineering, Part A: Systems, 144(11):04018068, 2018.
  * [12] Morgan Quigley, Ken Conley, Brian Gerkey, Josh Faust, Tully Foote, Jeremy Leibs, Rob Wheeler, Andrew Y Ng, et al.  Ros: an open-source robot operating system.  In ICRA workshop on open source software, volume 3, page 5. Kobe, Japan, 2009.
  * [13] Shital Shah, Debadeepta Dey, Chris Lovett, and Ashish Kapoor.  Airsim: High-fidelity visual and physical simulation for autonomous vehicles.  In Field and service robotics, pages 621–635. Springer, 2018.
  * [14] Raphael E Stern, Shumo Cui, Maria Laura Delle Monache, Rahul Bhadani, Matt Bunting, Miles Churchill, Nathaniel Hamilton, Hannah Pohlmann, Fangyu Wu, Benedetto Piccoli, et al.  Dissipation of stop-and-go waves via control of autonomous vehicles: Field experiments.  Transportation Research Part C: Emerging Technologies, 89:205–221, 2018.
  * [15] Cathy Wu, Aboudy Kreidieh, Kanaad Parvate, Eugene Vinitsky, and Alexandre M Bayen.  Flow: Architecture and benchmarking for reinforcement learning in traffic control.  arXiv preprint arXiv:1710.05465, 10, 2017.
  * [16] Ge Zhu, Yuche Chen, and Jiali Zheng.  Modelling the acceptance of fully autonomous vehicles: a media-based perception and adoption model.  Transportation research part F: traffic psychology and behaviour, 73:80–91, 2020.


Phuong Tran  Candidate

Electrical and Computer Engineering

Department

This thesis is approved, and it is acceptable in quality and form for
publication:
Approved by the Thesis Committee:

Marios Pattichis, Chairperson

Sylvia Celedon-Pattichis Lei Yang

Master of Science
Computer Engineering

Thesis

B.S., Computer Science, 2018

# Fast Video-based Face Recognition in Collaborative Learning Environments

Phuong Tran

(December, )

###### Abstract

Face recognition is a classical problem in Computer Vision that has
experienced significant progress recently. Yet, face recognition in videos
remains challenging. In digital videos, face recognition is complicated by
occlusion, pose and lighting variations, and persons entering and leaving the
scene. The goal of the thesis is to develop a fast method for face recognition
in digital videos that is applicable to large datasets. Instead of the
standard video-based methods that are tested on short videos, the goal of the
approach is to be applicable to long educational videos of several minutes to
hours, with the ultimate goal of testing over a thousand hours of videos.

The thesis introduces several methods to address the problems associated with
video face recognition. First, to address issues associated with pose and
lighting variations, a collection of face prototypes is associated with each
student. Second, to speed up the process, sampling, K-means Clustering, and a
combination of both are used to reduce the number of face prototypes
associated with each student. Third, to further speed up the method, the
videos are processed at different frame rates. Fourth, the thesis proposes the
use of active sets to address occlusion and also to eliminate the need to
apply face recognition on video frames with slow face motions. Fifth, the
thesis develops a group face detector that recognizes students within a
collaborative learning group, while rejecting out-of-group face detections.
Sixth, the thesis introduces a face DeID for protecting the identities of the
students. Seventh, the thesis uses data augmentation to increase the size of
the training set. The different methods are combined using multi-objective
optimization to guarantee that the full method remains fast without
sacrificing accuracy.

To test the approach, the thesis develops the AOLME dataset that consists of
138 student faces with 81 boys and 57 girls of ages 10 to 14, which were
predominantly Latina/o students. The video dataset consists of 3 Cohorts, 3
Levels from two schools (Urban and Rural) throughout the course of 3 years.
Each Cohort and Level contain multiple sessions and an average of 5 small
groups of 4 students per school. Each session has from 4 to 9 videos that
average 20 minutes each. The thesis trained on different video clips for
recognizing 32 different students from both schools. The training and
validation datasets consisted of 22 different sessions, whereas the test set
contained videos from seven other sessions. Different sessions were used for
training, validation, and testing. The video face recognition was tested on 13
video clips extracted from different groups, with a duration that ranges from
10 seconds to 10 minutes. Compared to the baseline method, the final optimized
method resulted in very fast recognition times with significant improvements
in face recognition accuracy. Using face prototype sampling only, the proposed
method achieved an accuracy of 71.8% compared to 62.3% for the baseline
system, while running 11.6 times faster.

To my parents Xuyen and Tran, grandma Van, grandma Gai, grandpa An, and my
late grandfather Mai for believing in me and for always being there for me.

###### Acknowledgements.

First and foremost, I would like to thank my advisor Professor Marios
Pattichis for all his patience in providing me with great advice. I would not
have done it without his unconditional support and help. I would also like to
thank my thesis committee members: Professor Sylvia Celedón-Pattichis and
Professor Lei Yang, not only for being on my committee and letting me present
my work, but also for their constructive feedback. I would like to acknowledge
Uncle Huan and Auntie Khanh for supporting me when I first came to the US, and
for their continuing unconditional support. I also would like to thank Ms.
Phuong Nguyen and Thuy-Hang Cao for being there when I most needed it. Lastly,
I’d like to show my appreciation to my ivPCL lab-mates and Miguel Angel
Hombrados Herrera for being there through the ups and downs. This material is
based upon work supported by the National Science Foundation under Grant No.
1613637, No. 1949230, and No. 1842220. Any opinions or findings of this thesis
reflect the views of the author. They do not necessarily reflect the views of
NSF.

Longest string

Intersection over Union is an evaluation metric used to measure the accuracy
of an object detector on a particular dataset. The IoU is the ratio of the
overlapping area of ground truth and predicted area to the total area.

The Advancing Out-of-School Learning in Mathematics and Engineering research
study

state-of-the-art

The center point in a countour

A set of labelled data that serves as a point of comparison

Convolutional Neural Network

DEEP Convolutional Neural Network

De-Identification


#  Kaleidoscopic Symmetries and Self-Similarity of Integral Apollonian Gaskets

Indubala I Satija  Department of Physics, George Mason University , Fairfax,
VA 22030, USA

###### Abstract

We describe various kaleidoscopic and self-similar aspects of the integral
Apollonian gaskets - fractals consisting of close packing of circles with
integer curvatures. Self-similar recursive structure of the whole gasket is
shown to be encoded in transformations that forms the modular group $SL(2,Z)$.
The asymptotic scalings of curvatures of the circles are given by a special
set of quadratic irrationals with continued fraction $[n+1:\overline{1,n}]$ \-
that is a set of irrationals with period-2 continued fraction consisting of
$1$ and another integer $n$. Belonging to the class $n=2$, there exists a
nested set of self-similar kaleidoscopic patterns that exhibit three-fold
symmetry. Furthermore, the even $n$ hierarchy is found to mimic the recursive
structure of the tree that generates all Pythagorean triplets

###### pacs:

03.75.Ss,03.75.Mn,42.50.Lc,73.43.Nq

Integral Apollonian gaskets$(\mathcal{IAG})$IAG  such as those shown in figure
(1) consist of close packing of circles of integer curvatures (reciprocal of
the radii), where every circle is tangent to three others. These are fractals
where the whole gasket is like a kaleidoscope reflected again and again
through an infinite collection of curved mirrors that encodes fascinating
geometrical and number theoretical conceptsAP . The central themes of this
paper are the kaleidoscopic and self-similar recursive properties described
within the framework of Möbius transformations that maps circles to
circlesCmap .

Figure 1:  Integral Apollonian gaskets. The gaskets shown in panels (A) and
(B) are dual to each other, as illustrated in panel (C) where we overlay the
two gaskets. The duality described by the matrix $\mathcal{D}$ ( displayed in
lower left ) corresponds to each circle in the dual set passing through three
of the tangency points of the original set of circles, and the reverse holds
as well. For example, $(-1,2,2,3)^{T}=\mathcal{D}(4,1,1,0)^{T}$ and
$(4,1,1,0)=\mathcal{D}(-1,2,2,3)^{T}$.

Named in honor of Apollonius of Perga who studied the geometrical problem of
mutually tangent circles before 300BC, the building block of Apollonian
gaskets are configurations of four mutually tangent circles whose curvatures
$(\kappa_{1},\kappa_{2},\kappa_{3},\kappa_{4})$ satisfy the following
relationprime ; J1 :

$2(\kappa_{1}^{2}+\kappa_{2}^{2}+\kappa_{3}^{2}+\kappa_{4}^{2})=(\kappa_{1}+\kappa_{2}+\kappa_{3}+\kappa_{4})^{2}.$
(1)

Here, the curvature of the outer circle that encloses all inner circles has to
be taken negative to satisfy an equation. Eq. (1)), known as the Descartes
theorem, can also be written as $v\mathcal{D}v^{T}=0$. Here
$v=(\kappa_{1},\kappa_{2},\kappa_{3},\kappa_{4})$ and $v^{T}$ is its transpose
and the matrix $\mathcal{D}$ is defined in Fig. (1). Configuration of circles
satisfying Descartes theorem will be referred as the “Descartes
configurations”. Originally discussed by French philosopher and mathematician
René Descartes in $1643$ in a letter to Princess Elizabeth of Bohemia,
Apollonian circles were rediscovered in $1936$ by Chemistry Nobel laureate
Frederick Soddy who published in Nature a poetic version of Descartes’
theorem, which he called “The Kiss Precise”.

For a given integral Apollonian packing, the investigations about its
Diophantine propertiesJ2  such as what integers appear as curvatures and the
number of circles with prime curvatures have piqued many mathematiciansprime .
The formula for the number of primes in an integral Apollonian gasket bears a
striking resemblance to the Prime Number Theorem.prime . These questions have
been intimately linked to the hidden symmetries and consequently the
deceptively simple geometrical construction of close packing of circles is
strongly tied with sophisticated mathematics involving group theory.
Furthermore, recent studies have shown that these abstract fractals are
related to a quantum fractal known as the Hofstadter butterfly Hof  which
models all possible integer quantum Hall statesQHE  \- the exotic topological
states of matterbook ; IIS2 ; IIS1 . A detailed investigation of the recursive
nature of the integral Apollonian gasket using Möbius transformations that
form modular group $SL(2,Z)$ as described here shows that in close analogy to
the integer curvatures of the gasket, the recursive structure of the
topological quantum numbers of the butterfly, explained earlierSW  using
quantum mechanics are in fact rooted in pure geometry and number theory.

An exercise in geometry as illustrated in Figure (2), shows how to obtain a
configuration of four mutually tangent circles starting with any three points.
As every Descartes configuration is fully determined by three distinct points
in a plane, this implies that any two such configurations are related by a
unique conformal map - a Möbius transformationCmap  of the complex plane of
the form,

${\displaystyle z\mapsto f(z)={\frac{az+b}{cz+d}}}$ (2)

A brief review of some of the properties of these transformations is given in
Appendix A. Section 1 illustrates kaleidoscopic properties of the
$\mathcal{IAG}$. In Section 2, we introduce the Ford Apollonian gasket in
which each circle’s curvature is the square of some non-negative integer. Its
recursive structure is described in Section 3, by a Möbius transformation that
forms $SL(2,Z)$ group where $(a,b,c,d)$ in the map (2) are integers and
Section (4) discusses its scaling properties. In section 5, Möbius maps that
belongs to the group $SL(2,C)$ where $(a,b,c,d)$ are in general complex
numbers, are shown to map the entire $\mathcal{IAG}$ to the Ford Apollonian
gasket. Section 6 shows one of a kind self-similar kaleidoscopic patterns of
the gasket. In Section 7, the hierarchical pattern of the Pythagorean tree is
shown to encode part of the recursions of the $\mathcal{IAG}$. In section (8)
we discuss the Apollonian group and its relation to modular group $SL(2,Z)$.
Appendix B gives a proof of Descartes theorem for Ford Apollonian
configurations where it is shown to be a consequence of a property of the
homogeneous functions.

Figure 2:  (A) Given any three points $(P_{1},P_{2},P_{3})$, one can construct
a configuration of three mutually tangent circles of curvatures
$(\kappa_{1},\kappa_{2},\kappa_{3})$: we first draw a circle ( dotted blue )
through these points and then draw tangents to this circle. Three tangents
meet at $C_{1}$, $C_{2}$ and $C_{3}$ and using $(C_{1},C_{2},C_{3})$ as the
centers, we now draw three circles which are mutually tangent as the distance
between $P_{1}$ and $C_{1}$ is same as the distance between $P_{2}$ and
$C_{2}$ and so on. The curvature $\kappa_{4}$ and hence the radius of the
fourth circle is determined by Descartes theorem ( Eq. (1)) . The center
$C_{4}$ is determined in terms of the curvatures of the four circles4circle .

##  I  Apollonian Gasket - A Kaleidoscope

Apollonian gaskets exhibit numerous kaleidoscopic symmetries - a rare and
fascinating feature among known functions. In various figures below, the
circular mirrors describing kaleidoscopic symmetries will be shown as dotted
blue circles.

The existence of a simplest kaleidoscope in a gasket follows from the
Descartes formula (1). Given any three mutually tangent circles of curvatures
$(\kappa_{1},\kappa_{2},\kappa_{3})$, there are exactly two possible circles
$\kappa_{4}$ or $\bar{\kappa}_{4}$ that are tangent to these three circles:

$\kappa_{4}(\bar{\kappa}_{4})=(\kappa_{1}+\kappa_{2}+\kappa_{3})\pm
2\sqrt{\kappa_{1}\kappa_{2}+\kappa_{2}\kappa_{3}+\kappa_{3}\kappa_{2}}$ (3)

Equation (3) leads to a linear equation connecting the two solutions:

$\kappa_{4}+\bar{\kappa}_{4}=2(\kappa_{1}+\kappa_{2}+\kappa_{3}).$ (4)

This linear equation implies that if the original four circles have integer
curvature, all of the circles in the packing will have integer curvatures.
This is because starting with three mutually tangent circles, we can construct
two distinct quadruplets $(\kappa_{1},\kappa_{2},\kappa_{3},\kappa_{4})$ and
$(\kappa_{1},\kappa_{2},\kappa_{3},\bar{\kappa}_{4})$ and thus adding
additional circles to the gasket. In fact we obtain the entire gasket as the
equation (4) can also be written as
$\kappa_{2}+\bar{\kappa}_{2}=2(\kappa_{1}+\kappa_{4}+\kappa_{3})$ and so on.

Figure 3:  Examples of circular mirrors shown as dotted blue lines. Upper
panel shows that the two solutions of (4) are mirror image. The lower two
panels show two examples: Pappus chain - chain of (blue) circles that are
tangent to two mutually tangent (black) circles $(\kappa_{1},\kappa_{2})$
which are mirror images of each other through Pappus mirror ( ( dotted blue
circles) . Pappus mirror passes through the tangency points of Pappus chain
and it reflects $\kappa_{1}$ and all the circles that are tangent to it ( red
circles) to $\kappa_{2}$ and all the circles that are tangent to it ( green
circles ).

A remarkable aspect of the pair of solutions such as
$(\kappa_{4},\bar{\kappa}_{4})$ is that they are mirror images of each other
through a circular mirror that passes through the tangency points of
$(\kappa_{1},\kappa_{2},\kappa_{3})$ as shown in Fig. (3). Therefore, packing
of circles in the whole gasket is via kaleidoscopic images in the curvilinear
triangular spaces in between the circles.

Lower caption in Fig. (3) shows a different kind of mirror due to global
symmetries where an entire hierarchical pattern and its mirror image is part
of the gasket. Given two tangent circles of curvatures $\kappa_{1}$ and
$\kappa_{2}$, there exists a chain of (blue) circles where two consecutive
circles of the chain are tangent to each other as seen in the figure. These
are examples of Pappus chains, investigated by Pappus of Alexandria in the 3rd
century Pchain . The tangency points of the chains of circles lie on a circle.
The circular mirror at these tangency points - dubbed Pappus mirror” reflect
$\kappa_{1}$ into $\kappa_{2}$ and also the entire hierarchical set of circles
that are tangent to $\kappa_{1}$ ( red circles) to the hierarchical set that
are tangent to $\kappa_{2}$ ( green circles). In other words, for the
hierarchical configuration, where all circles share a common circle, which we
refer as the “boundary circle”, there exists twin configuration - its mirror
image. We emphasize that the hierarchical sets under consideration here
consist of self-similar Descartes configuration that share the boundary
circle. Two mutually tangent circles of curvatures $\kappa_{1}$ and
$\kappa_{2}$ are respectively the boundary circles for the red and the green
hierarchy and all the circles in the Pappus chains are tangent to both these
boundary circles.

Figure 4:  Self-similar kaleidoscopic symmetry in a hierarchy where the outer
circle (green) becomes the inner circle (red) at the next level of the
hierarchy. Inner and outer circles are mirror images through (dotted) blue
circle. As we zoom into the innermost circles ( whose curvatures are shown
below the arrows), we see a scaled version of the original pattern. The
sequence of ratios of curvatures $(15/1,209/15,2911/209,40545/2911,...)$
approaches a constant $(2+\sqrt{3})^{2}$ .

A rather exotic kind of hierarchical kaleidoscopic phenomena prevalent in
packing of circles is shown in Figure (4) where the object and its mirror
image are self-similar. In other words, there exists some special set of
recursive patterns in the gasket that are captured by kaleidoscopes that
reproduce the exact replica of the original set after appropriate scaling.
Relationship of this self-similar kaleidoscope that exhibits three-fold
symmetry with the gasket in figure (1) will be discussed later.

##  II  Ford Circles

Figure 5:  Gasket made up of Ford circles where each circle with center at
$(\frac{p}{q},\frac{1}{2q^{2}})$ represents a primitive fraction
$\frac{p}{q}$. After scaling by a factor of $2$, curvatures of all Ford
circles are integer-squared.

Perhaps the simplest example of an hierarchical set consisting of packing of
circles is a gasket made up circles where the curvatures of all the circles
are integer-squared. These circles are tangent to the $x$-axis and provide a
pictorial representation of fractions as discovered by an American
mathematician Lester Ford in $1938$. Ford showedFord  that at each rational
point $\frac{p}{q}$ where $p$ and $q$ are relatively prime, one can draw a
circle of radius $\frac{1}{2q^{2}}$ and whose center is the point
$(x,y)=(\frac{p}{q},\frac{1}{2q^{2}})$. Tangent to the x-axis in the upper
half of the $xy$-plane, the curvatures of the Ford circles are $2q^{2}$.
Circles in the figure (5) have their curvatures $q^{2}$, scaled by a factor of
half from Ford circles. We will continue to refer them as the Ford circle
representing the fraction $\frac{p}{q}$ and label them as
$\kappa_{\frac{p}{q}}$.

The key characteristic of the Ford circles is the fact that two Ford circles
representing two distinct fractions never intersect. The closest they can come
is being tangent to each other. This happens when the two fractions are “Farey
neighbors”, neighboring fractions in the Farey tree. Three mutually tangent
Ford circles representing three (left, center and right ) fractions
$\phi_{L}=\frac{p_{L}}{q_{L}}$, $\phi_{c}=\frac{p_{c}}{q_{c}}$ ,
$\phi_{R}=\frac{p_{R}}{q_{R}}$ , all tangent to the $x$-axis form a special
case of Descartes configuration obeying the Farey relationFord ,

$\frac{p_{c}}{q_{c}}=\frac{p_{L}+p_{R}}{q_{L}+q_{R}}$ (5)

Consequently, the triplet of Farey neighbors, referred as the friendly triplet
satisfy the follow identities:

$|q_{\rm L}p_{\rm R}-q_{\rm R}p_{\rm L}|=1,\,\,\ |q_{\rm L}p_{\rm c}-q_{\rm
c}p_{\rm L}|=1,\,\,\ |q_{\rm R}p_{\rm c}-q_{\rm c}p_{\rm R}|=1\ .$ (6)

Figure (5) shows an Apollonian gasket made up of the Ford circles where the
curvatures are integer squared and we will refer such gaskets as the “ Ford
Apollonian gasket”. The dual of the Ford Apollonian gasket a subset of circles
seen in figure (1) that exhibit reflection symmetry about the $x$-axis
satisfying $\kappa_{1}+\kappa_{2}=\kappa_{3}+\kappa_{4}$ . In the rest of the
paper, we will denote Descartes configuration of Ford circles representing the
friendly triplet
$[\frac{p_{L}}{q_{L}},\frac{p_{c}}{q_{c}},\frac{p_{R}}{q_{R}}]$ as
$(\kappa_{c},\kappa_{R},\kappa_{L})$ and its dual as
$(-\kappa_{0},\kappa_{1},\kappa_{2},\kappa_{3})$. Here
$\kappa_{c}>\kappa_{R}>\kappa_{L}$ and
$\kappa_{0}<\kappa_{1}<\kappa_{2}<\kappa_{3}$.

It was pointed out by Richard FriedbergRF  that the Descartes’s theorem when
applied to Ford circles is a consequence of a property of homogeneous
functions of any three variables $(\lambda_{1},\lambda_{2},\lambda_{3})$ with
$\lambda_{1}\pm\lambda_{2}\pm\lambda_{3}=0$. In view of the Farey relation
$q_{c}=q_{L}+q_{R}$, as shown in the Appendix B, this gives
$2(q_{1}^{4}+q_{2}^{4}+q_{3}^{2})=(q^{2}_{1}+q_{2}^{2}+q_{3}^{2})^{2}$ which
is the simplified version ( $\kappa_{4}=q_{4}^{2}=0$ ) of the Descartes
theorem with three mutually tangent Ford circles, tangent to the $x$-axis.

The Ford Apollonian gasket has certain properties that play an important role
in determining the self-similar scalings of the entire Apollonian gasket even
through the Ford circles form only a small subset of the fractal. Central
result of this paper is that packing of the Ford circles determines the self-
similar properties of the entire gasket. Further, there is a dichotomy in the
recursive structure of the gasket as half of the gasket seems to follow the
recursive pattern of the Pythagorean treeSatPT . In addition, Ford circles
also have a partner - a symmetric Descartes configuration where two of the
three inner circles have same curvature and there exists a very special
configuration that evolves into three-fold symmetrybook  as shown in Fig. (4).
These three-fold symmetric configurations that exhibit a self-similar
hierarchy with Kaleidoscopic symmetries lay scattered throughout the whole
gasket.

##  III  Self-Similarity of Ford Apollonian Gasket

Figure 6: With the root configuration
$(\kappa_{c},\kappa_{R},\kappa_{L})=(4,1,1)$ representing three fractions
$(z_{1},z_{2},z_{3})=(\frac{0}{1},\frac{1}{2},\frac{1}{1})$, we pick any other
configuration of three mutually tangent Ford circles labeling three fractions
as
$(w_{1},w_{2},w_{3})=(\frac{p^{*}_{L}}{q^{*}_{L}},\frac{p^{*}_{c}}{q^{*}_{c}},\frac{p^{*}_{R}}{q^{*}_{R}})$
representing left, central and right circle. In principle, one can choose any
of the three tangency points and their corresponding image of the Descartes
configurations, that is, $z_{i}$ and $w_{i}$ need not lie on the $x$-axis. The
choice indicated here simplifies the derivation of the recursion relation.

To establish recursion relations associated with the nesting of the Ford
circles, we relate two sets of triplets: namely $(z_{1},z_{2},z_{3})$ and
$(w_{1},w_{2},w_{3})$ as shown in figure (6). The self-similar hierarchy
preserves this relationship at all levels and we will denote two successive
sets as $[\phi_{L}(l),\phi_{c}(l),\phi_{R}(l)]$ and
$[\phi_{L}(l+1),\phi_{c}(l+1),\phi_{R}(l+1)]$. The recursion relation
underlying the self-similar pattern is a fixed Möbius transformation
determined by mapping the triplets $(z_{1},z_{2},z_{3})=(0,\frac{1}{2},1)$ to
the triple
$(w_{1},w_{2},w_{3})=(\frac{p^{*}_{L}}{q^{*}_{L}},\frac{p^{*}_{c}}{q^{*}_{c}},\frac{p^{*}_{R}}{q^{*}_{R}})=(\phi^{*}_{L}(1),\phi^{*}_{C}(1),\phi^{*}_{R}(1))$.

To determine the constants $(a,b,c,d)$ of the map $w=f(z)=\frac{az+b}{cz+d}$,
we note that :

$f(0)=\frac{b}{d}=\frac{p^{*}_{L}}{q^{*}_{L}},\,\,\,\,\
f(1/2)=\frac{a+b}{c+d}=\frac{p^{*}_{R}}{q^{*}_{R}},\,\,\,\,\
f(1)=\frac{a+b}{c+d}=\frac{p^{*}_{R}}{q^{*}_{R}}$ (7)

Using the Farey relation (Eq. (6)), we get

$a=p^{*}_{R}-p^{*}_{L},\,\ b=p^{*}_{L},\,\ c=q^{*}_{R}-q^{*}_{L},\,\,\
d=q^{*}_{L}$ (8)

Therefore, the Möbius map that underlies the recursive structure of the Ford
Apollonian gasket is given by a matrix, which we denote as $\mathcal{F^{*}}$.
The corresponding $\phi=\frac{p}{q}$ recursions can be written as,

$\phi(l+1)=\frac{(p^{*}_{R}-p^{*}_{L})\phi(l)+p^{*}_{L}}{(q^{*}_{R}-q^{*}_{L})\phi(l)+q^{*}_{L}}\equiv\frac{ap+bq}{cp+dq}\equiv\mathcal{F}^{*}$
(9)

This can also be written in terms of the recursions for numerator $p_{x}$ and
the denominator $q_{x}$ of the fraction $\frac{p_{x}}{q_{x}}$ where $x=L,c,R$,

$\left(\begin{array}[]{c}p_{x}(l+1)\\\
q_{x}(l+1)\end{array}\right)=\mathcal{F}^{*}\left(\begin{array}[]{c}p_{x}(l)\\\
q_{x}(l)\end{array}\right)$ (10)

Figure 7:  Upper and lower panels respectively illustrate $n^{*}=1$ and
$n^{*}=2$ self-similar hierarchies where three panels in each case represent
three levels of the hierarchy consisting of Ford circles. Starting from the
root Apollonian( black circles), we pick an Apollonian ( red circles ).The
self-similar hierarchy corresponds to continuing this process iteratively
where the relationship between two successive iterations is preserved. That is
the relation between $(4,1,1)$ and $(25,9,4)$ is the same as the relation
between $(25,9,4)$ and $(169,64,25)$ and so on. Asymptotic scale invariance is
signaled as $25/4=6.25,169/25=6.76\rightarrow(\frac{3+\sqrt{5}}{2})^{2}\approx
6.85$ ( golden-hierarchy, upper panels) and
$121/9=13.44,1681/121=13.89\rightarrow(2+\sqrt{3})^{2}\approx 13.93$ ( diamond
hierarchy, lower panels). As described later, the lower hierarchy where the
parity of $q_{c}$ is conserved, mimics the tree structure of the Pythagorean
tree.

##  IV Scaling

With unit determinant, the eigenvalues of the transformation matrix
$\mathcal{F^{*}}$ are real. Denoting the pair of these eigenvalues as
$(\zeta,\zeta^{-1})$, $\zeta>1$ determinesbook  the asymptotic scaling factors
as:

$\zeta=\lim_{l\rightarrow\infty}\frac{p_{x}(l+1)}{p_{x}(l)}=\lim_{l\rightarrow\infty}\frac{q_{x}(l+1)}{q_{x}(l)}=\frac{(q^{*}_{L}+p^{*}_{R}-p^{*}_{L})}{2}\pm\sqrt{\left(\frac{q^{*}_{L}+p^{*}_{R}-p^{*}_{L}}{2}\right)^{2}-1},$
(11)

The ratio of curvatures of the circle at two successive levels is given by,

$\lim_{l\rightarrow\infty}\frac{\kappa(l+1)}{\kappa(l)}\rightarrow\zeta^{2}$
(12)

Expressed as a continued fraction expansion, these irrationals satisfy the
quadratic equation $\zeta^{2}+n^{*}\zeta-n^{*}$ whose solutions are given by,

$\zeta=[n^{*}+1;\overline{1,n^{*}}],\,\ n^{*}=q^{*}_{L}+p^{*}_{R}-p^{*}_{L}-2$
(13)

Figure (7) shows two examples of self-similar Descartes configurations of Ford
circles corresponding to $n^{*}=1$ (upper panel) and $n^{*}=2$ (lower panel).
Respectively referred as the golden and the diamond hierarchiesbook , they
correspond to the Möbius transformations
$f(z)=\frac{1}{-z+3}\equiv\left(\begin{array}[]{cc}0&1\\\ -1&3\\\
\end{array}\right)$ and
$f(z)=\frac{z+1}{2z+3}\equiv\left(\begin{array}[]{cc}1&1\\\ 2&3\\\
\end{array}\right)$. The eigenvalues of these two matrices
$\frac{3\pm\sqrt{5}}{2}$ and $2\pm\sqrt{3}$ determine the scaling factor
$\zeta$. We emphasize that the Möbius map (9) captures the self-similarity of
the whole gasket provided the root configuration is $(4,1,1)$. General case
with arbitrary root is described later.

##  V  Self-Similar Hierarchies with non-Ford circles

The Möbius transformations map circles to circles, preserving tangencies.
Therefore, every Descartes configurations consisting of “non-Ford circles” -
circles that are not tangent to $x$-axis, can be related to the Ford circles.
The process of describing the self-similarity of the non-Ford hierarchies
involves first finding the conformal image of the hierarchy of the non-Ford
circles to the corresponding Ford circles. One can then use the equation (9)
to describe the self-similar characteristics. Fig. (8) illustrates this
process when the non-Ford circle hierarchical pattern is tangent to
$\kappa_{\frac{0}{1}}$. In this example, we first obtain the Möbius
transformation that maps the $x$-axis to $\kappa_{\frac{0}{1}}$ in the complex
plane. As shown in the left panel, the three points on the $x$-axis and their
conformal images on $\kappa_{\frac{0}{1}}$ can be chosen as:
$z_{1}=0\rightarrow w_{1}=0,\,\ ,\ z_{2}=\frac{1}{2}\rightarrow
w_{2}=\frac{2}{5}+\frac{i}{5},\,\,\,\ z_{3}=\frac{1}{3}\rightarrow
w_{3}=\frac{3}{10}+\frac{i}{10}$ The resulting map is given by
$\mathcal{B}:z\rightarrow w=f(z)=\frac{z}{-iz+1}$. Its inverse transforms the
green circles to the red circles, and therefore, the hierarchical structure of
the non-Ford circles is given by the general map
$\mathcal{B}^{-1}\mathcal{F^{*}}\mathcal{B}$. Eq. (9) determines $F^{*}$ where
$p^{*}_{L}=1$, $q^{*}_{L}=3$, $p_{R}^{*}=1$ and $q_{R}^{*}=2$.

Figure 8:  The green and the red boxes in the left panel respectively show the
locations of the nesting patterns of the green and the red circles - the two
hierarchies shown in the upper and lower right panels. These two hierarchies
exhibit same scaling exponents. There distinct Descartes configurations of red
and green circles show three levels of the self-similar hierarchies.

Table (1) gives some examples of Möbius transformations that relate $x$-axis
to other circles in the $\mathcal{IAG}$. The corresponding “mirrors” listed in
the table ( see Fig. (9) ) provides geometrical representation of this
mapping. We note that with the first three entries in the Table that show the
mappings of the $x$-axis to the Ford circles $\kappa_{\frac{p}{q}}$ can be
written as $g(z)=\frac{1}{q^{2}}f(q^{2}(z-\frac{p}{q}))+\frac{p}{q}$ where
$f(z)=\frac{z}{-iz+1}$ maps the $x$-axis to $\kappa_{\frac{0}{1}}$. These
transformations form a subgroup of $SL(2,C)$ with trace, $a+d=2$. They are
“parabolic as they have only one fixed point.

All the transformations described in the table have unit determinant and real
trace. Such transformations, which we denote as $\mathcal{B}$, that relate
boundary circle $\kappa_{\frac{p}{q}}$ of an hierarchy to the $x$-axis, the
self-similar recursive pattern is given by
$\mathcal{B}\mathcal{F}^{*}\mathcal{B}^{-1}$. Therefore, the scaling factor
associated with the hierarchy is same as the scaling factor associated with
their corresponding Ford circle hierarchy.

Nature of Map | f(z) | Equation of the Mirror
---|---|---
$x$\- axis $\rightarrow\kappa_{\frac{0}{1}}$ | $\frac{z}{-iz+1}$ | $x^{2}+(y-1)^{2}=1$
$x$\- axis $\rightarrow\kappa_{\frac{1}{2}}$ | $\frac{(1-2i)z+i}{-4iz+(1+2i)}$ | $(x-\frac{1}{2})^{2}+(y-\frac{1}{2})^{2}=(\frac{1}{2})^{2}$
$x$\- axis $\rightarrow\kappa_{\frac{1}{3}}$ | $\frac{(1-3i)z+i}{-9iz+(1+3i)}$ | $(x-\frac{1}{3})^{2}+(y-\frac{2}{9})^{2}=(\frac{2}{9})^{2}$
$x$\- axis $\rightarrow\kappa_{\bar{\frac{2}{5}}}$ | $\frac{(2-5i)z+2i}{-14iz+(2+5i)}$ | $(x-\frac{5}{14})^{2}+(y-\frac{2}{7})^{2}=(\frac{1}{7})^{2}$

Table 1:  Examples of Möbius transformations and the corresponding mirrors
that map $x$-axis to the Ford circles $\kappa_{\frac{p}{q}}$ or the conformal
images of the Ford circle, tangent to $\kappa_{\frac{0}{1}}$, which we denote
as $\kappa_{\bar{\frac{p}{q}}}$. Fig. (9) shows two examples of the mirrors,
corresponding to the first two entries in this table.

.

Figure 9:  Left and right panels show the Pappus chains ( blue circles ) and
the corresponding Pappus mirrors ( dotted blue circles ) that reflect the
x-axis to $\kappa_{\frac{0}{1}}$ and $\kappa_{\frac{1}{2}}$ respectively. The
red and the green boxes are the triangular regions hosting circles that are
mirror images of each other.

Finally, when the root configuration is not the $(4,1,1)$, the chosen root is
conformally mapped to $(4,1,1)$ as illustrated in figure (10). In this
example, using the triplet $(z_{1},z_{2},z_{3})$ and its image
$(w_{1},w_{2},w_{3})$ leads to the map
$\mathcal{B}:w=f(z)=\frac{(3-i)z-1}{(-3i)z+i}$ that transforms the chosen root
to $(4,1,1)$. We then use the map
$\mathcal{F^{*}}:z\rightarrow\frac{z+1}{2z+3}$ that describes the self-similar
recursions in the Ford circles in the lower panel. In other words, the self-
similar characteristics of the upper panel hierarchy is described by the map
$\mathcal{B}\mathcal{F}^{*}\mathcal{B}^{-1}$.

Figure 10:  (Upper) Starting with a root Apollonian $(28,9,4,1)$, we select a
configuration $(568,217,72,9)$ (red circles) that bears the same relationship
with the root as $(64,25,9)$ (lower panel) bears with the main root $(4,1,1)$
associated with the Ford Apollonian gasket. Using $(z_{1},z_{2},z_{3})$ from
the upper graph and their corresponding $(w_{1},w_{2},w_{3})$ in the lower
graph, we obtain the Möbius map
$\mathcal{B}:w=\frac{(-9+6i)z+(4-i)}{(-14+16i)z+(7-4i)}$ that transforms the
root $(28,9,4,1)$ to $(4,1,1)$.

##  VI  Self-Similar Kaleidoscope

Among the infinity of self-similar hierarchies in the $\mathcal{IAG}$, there
is one type of a hierarchy that is characterized by a very unique symmetry
shown in Fig. (4) and also in Fig. (11). These configurations are related to
the Ford Apollonian as every Descartes configuration of the Ford circles can
be mapped to another Descartes configuration of the non-Ford circles where two
of the inner circles have the same curvaturesbook . In other words, given
$(\kappa_{c},\kappa_{R},\kappa_{L})$ or its dual
$(-\kappa_{0},\kappa_{1},\kappa_{2},\kappa_{3})$, we can find a Descartes
configuration which we denote as
$(\kappa^{s}_{a},\kappa^{s}_{b},\kappa^{s}_{b},\kappa^{s}_{c})$ where,

$\kappa_{a}^{s}=\eta\kappa_{0},\,\,\
\kappa_{b}^{s}=\frac{\eta}{2}(\kappa_{1}+\kappa_{2}),\,\,\
\kappa_{c}^{s}=\eta(2\kappa_{1}-\kappa_{0})$ (14)
$\kappa_{a}^{s}=\frac{\eta}{2}(\kappa_{c}-\kappa_{R}-\kappa_{L}),\,\,\
\kappa_{b}^{s}=\frac{\eta}{2}\kappa_{c},\,\,\,\kappa_{c}^{s}=\frac{\eta}{2}(\kappa_{c}-\kappa_{R}+3\kappa_{L})$
(15)

Here $\eta=1$ for $\kappa_{0}$-odd and $\eta=2$ for $\kappa_{0}$-even.

Figure 11:  Symmetric partners corresponding to lower panel of Fig. (8) where
$\Delta=3$. The corresponding Fig. (4) describes the symmetric partners of the
upper panel of the Fig. (8) corresponding to $\Delta=1$. Differing in the
initial root, these two hierarchies belong to same universality class
characterized by scaling exponent $\zeta=(2+\sqrt{3})$.

Among these symmetric configurations, there exists a class of hierarchies
where the above configuration evolves towards an asymptotic three-fold
symmetrybook  as shown in figures (4) and (11).This is due to an invariant
$\Delta$book ,

$\Delta=\kappa^{s}_{b}-\kappa^{s}_{c},$ (16)

which remains unchanged under iteration of the recursions. In our detailed
study of various such configurations, differing in $\Delta$, which was always
found to be a prime number, all such hierarchies belong to the nested
configurations of the diamond hierarchy. Relationship of three fold symmetry
with diamond hierarchy follows from Eq. (1)book  as with
$\kappa_{1}=\kappa_{2}=\kappa_{3}$,
$\frac{\kappa_{4}}{\hat{\kappa}_{4}}=(2+\sqrt{3})^{2}$.

##  VII  Apollonian-Pythagorean Meet

Figure 12:  Upper panel shows mapping between two mutually tangent Ford
circles to a Pythagorean tripletSatPT . The lower panel shows the diamond
hierarchy described by $H_{1}H_{3}$, highlighted with thick dark lines along
with the Descartes configurations. Starting with the root $(4,1,1)$ that
corresponds to the Pythagorean triplet $(1,0,1)$, the triplets $(15,8,17)$ and
$(209,120,241)$ represent the level 1 and level 2 of Descartes configurations
shown in red circles.

The self-similar recursions described by the Ford Apollonian gasket
$(\kappa_{c},\kappa_{R},\kappa_{L})$ are found to belong to two classes
depending upon whether they preserve “parity”- that is even or oddness of
$\kappa_{c}$ (or $q_{c}$). It turns out that this parity conserving feature is
directly correlated with the parity of the integer $n^{*}$ ( see Eq. (13) ).
For the recursions characterized by even $n^{*}$, the parity is conserved
while for the recursions with odd-$n^{*}$, the parity is not conserved. Fig.
(7) shows examples of both of these cases.

An interesting aspect of the parity conserving recursions is that they are
described by the Pythagorean treeciteHall, J3, SatPT . As shown in Fig. (12),
the Pythagorean tree provides orderly arrangements of all primitive
Pythagorean triplets $(n_{x},n_{y},n_{t})$ where
$n_{x}^{2}+n_{y}^{2}=n_{t}^{2}$ using three matrices $(H_{1},H_{2},H_{3})$:

$H_{1}=\left(\begin{array}[]{ccc}1&-2&2\\\ 2&-1&2\\\ 2&-2&3\\\
\end{array}\right),\,\,\ H_{2}=\left(\begin{array}[]{ccc}1&2&2\\\ 2&1&2\\\
2&2&3\\\ \end{array}\right),\,\,\,\ H_{3}=\left(\begin{array}[]{ccc}-1&2&2\\\
-2&1&2\\\ -2&2&3\\\ \end{array}\right)$ (17)

For example, with Pythagorean triple $v=(1,0,1)$, we see that
$H_{1}v^{T}=(5,12,13)^{T}$, and so on. There is also a two-dimensional
representation of $H_{i}$ using $2000$ year old Euclid parametrization of the
Pythagorean triplets given in terms of pair of integers $(q_{R},q_{L})$,
$q_{R}>q_{L}$ where,

$n_{x}=\eta(q_{L}q_{R}),\,\ n_{y}=\eta(\frac{q_{R}^{2}-q_{L}^{2}}{2}),\,\
n_{z}=\eta(\frac{q_{R}^{2}+q_{L}^{2}}{2}).$ (18)

Here $\eta=1$ when $q_{c}$ is even and hence $q_{L}$ and $q_{R}$ are both odd
integers and $\eta=2$ otherwise. The possibilities of generating three more
triplets from a given triplet, expressed in terms a pair $(q_{R},q_{L})$ can
be written as three $2\times 2$ matrices,

$h_{1}=\left(\begin{array}[]{cc}1&2\\\ 0&1\\\ \end{array}\right),\quad
h_{2}=\left(\begin{array}[]{cc}2&1\\\ 1&0\\\ \end{array}\right),\,\,\,\
h_{3}=\left(\begin{array}[]{cc}2&-1\\\ 1&0\\\ \end{array}\right)$ (19)

The hierarchical pattern of parity-conserving Ford Apollonian can be
associated with the hierarchical pattern of the Pythagorean treeSatPT . Given
a Ford Apollonian $(\kappa_{c},\kappa_{R},\kappa_{L})$, a linear
transformation relates the Apollonian to a Pythagorean triplet
$(n_{x},n_{y},n_{t})$ as:

$\displaystyle\left(\begin{array}[]{c}n_{x}\\\ n_{y}\\\ n_{t}\\\
\end{array}\right)$ $\displaystyle=$
$\displaystyle\frac{1}{\eta}\left(\begin{array}[]{ccc}1&-1&-1\\\ 0&1&-1\\\
0&1&1\\\ \end{array}\right)\left(\begin{array}[]{c}\kappa_{c}\\\ \kappa_{R}\\\
\kappa_{L}\\\ \end{array}\right),$ (29)

With $\eta=1$ or $2$, there are two Pythagorean trees related simply by
swapping $n_{x}$ and $n_{y}$.The key point to be noted here is that the
Pythagorean triplets in each of these two trees retain their parity along the
tree. Consequently, only parity conserving recursions of the Ford Apollonian
are described by the Pythagorean tree. As a consequence of this dichotomy in
characterization of self-similarity of an Apollonian gasket, half of the
hierarchies in the Ford Apollonian gaskets share the recursive structure of
the Pythagorean tree. The even parity hierarchies are generated by $(3,4,5)$
using $(H_{1},H_{2},H_{3})$ while the odd-parity hierarchy is generated by
$(4,3,5)$ using $(H_{3},H_{2},H_{1})$. The diamond hierarchies which conserves
$q_{c}$ parity as described above correspond to $H_{3}H_{1}$. The hierarchical
aspect of the golden hierarchy is not described by the tree as the
corresponding recursions do not conserve parity as seen in figure (7).
Recursions correspond to zigzagging between the $\eta=1$ and $\eta=2$
Pythagorean trees.

As a generalization of the relation between the Pythagorean triplet and the
Descartes configuration of the Ford circles, we note that the four curvatures
$(\kappa_{1},\kappa_{2},\kappa_{3},\kappa_{4})$ of any Descartes configuration
are related to the well known quadruplets - $(N_{x},N_{y},N_{z},N_{t})$J4 ,
known as the Lorentz quadruplets, where
$N_{x}^{2}+N_{y}^{2}+N_{z}^{2}=N_{t}^{2}$J2 . This relationship is given by,

$\displaystyle\left(\begin{array}[]{c}N_{x}\\\ N_{y}\\\ N_{z}\\\ N_{t}\\\
\end{array}\right)=\left(\begin{array}[]{cccc}1&-1&-1&-1\\\ 0&0&0&2\\\
0&1&-1&0\\\ 1&1&2&1\\\ \end{array}\right)\left(\begin{array}[]{c}\kappa_{1}\\\
\kappa_{2}\\\ \kappa_{3}\\\ \kappa_{4}\\\ \end{array}\right).$ (42)

It turns out that the Lorentz quadruplets associated with the four curvatures
need not be primitive as is found to be case with the golden hierarchy.
Furthermore, to best of our knowledge, there is no known quadruplet tree that
generates all the primitive or non-primitive Lorentz quadruplets. Therefore,
the representation of the $\mathcal{IAG}$ with a tree like structure of
Lorentz quadruplets remains an open question.

##  VIII  From simple Geometry to Elegant Group Theory

The geometric construction of kaleidoscopic images to describe Apollonian
packing can be formulated using Apollonian group where adding additional
circles is accomplished by applying four matrices to a root configurationAP .
Eq. (4) determines the four generators $S_{i},(i=1-4)$ of the group as,

$\displaystyle S_{1}=\left(\begin{array}[]{cccc}-1&2&2&2\\\ 0&1&0&0\\\
0&0&1&0\\\ 0&0&0&1\\\ \end{array}\right),\
S_{2}=\left(\begin{array}[]{cccc}1&0&0&0\\\ 2&-1&2&2\\\ 0&0&1&0\\\ 0&0&0&1\\\
\end{array}\right),\ S_{3}=\left(\begin{array}[]{cccc}1&0&0&0\\\ 0&1&0&0\\\
2&2&-1&2\\\ 0&0&0&1\\\ \end{array}\right),\
S_{4}=\left(\begin{array}[]{cccc}1&0&0&0\\\ 0&1&0&0\\\ 0&0&1&0\\\ 2&2&2&-1\\\
\end{array}\right)$

These generators do not describe self-similar characteristics of the gasket as
the application of $S_{i}$ on a column matrix consisting of four curvatures in
monotonic order does not result in a new set of curvatures that preserves the
monotonicity of the curvatures. That is, a self-similar hierarchy cannot be
associated with a string of $S_{i}$. However, It is possible to define an
alternative set of four matrices $D_{i}$ that preserves the monotonicity of
the curvatures:

$\displaystyle D_{1}=\left(\begin{array}[]{cccc}0&1&0&0\\\ 0&0&1&0\\\
0&0&0&1\\\ -1&2&2&2\\\ \end{array}\right),\
D_{2}=\left(\begin{array}[]{cccc}2&-1&2&2\\\ 1&0&0&0\\\ 0&0&1&0\\\ 0&0&0&1\\\
\end{array}\right),\ D_{3}=\left(\begin{array}[]{cccc}2&2&-1&2\\\ 1&0&0&0\\\
0&1&0&0\\\ 0&0&0&1\\\ \end{array}\right),\
D_{4}=\left(\begin{array}[]{cccc}2&2&2&-1\\\ 1&0&0&0\\\ 0&1&0&0\\\ 0&0&1&0\\\
\end{array}\right)$

Figure 13:  Without showing the Ford circles, the sequences of upper (nested
triplets of black and red dots) and lower (chain of black and blue dotes)
fractions show two levels of two distinct hierarchies, corresponding to
Descartes configurations described by the friendly triplets
$[0,1/2,1]\rightarrow[1/3,3/8,2/5]\rightarrow[4/11,11/50,7/19]...$ and
$[0,1/3,1/4]\rightarrow[1/3,5/14,4/11]\rightarrow[4/11,19/52,15/51].......$.
Recursions for both hierarchies are characterized by the same Möbius
transformation with scaling $(2+\sqrt{3})^{2}$. However, they differ in
$D_{i}$ and $H_{i}$ strings as described in the text.

The eigenvalues of the product of such matrices determine the self-similar
scalingIIS2 . The golden ( $n=1$) and the diamond ($n=2)$ hierarchies
described above are characterized by $D_{3}^{2}$ and $D_{3}^{2}D_{2}$, encoded
in the eigenvalues $((\frac{3\pm\sqrt{5}}{2})^{2},1,1)$ and
$(2\pm\sqrt{3})^{2},1,1)$ of these string of matrices.

As described earlier the self-similar properties of the whole gasket are
described by the Möbius transformations $w=f(z)=\frac{az+b}{cz+d}$ as shown in
equation (9). These transformations consisting of $2\times 2$ matrices of
integers with unit determinant form the “Modular group” $SL(2,Z)$ModularG .
Modular group is a sub group of $SL(2,C)$ \- a group of $2\times 2$ matrices
with unit determinant, where matrix entries are complex numbers. $SL(2,C)$
describes the recursive structure of the entire $\mathcal{IAG}$. Finally, we
note that with every self-similar hierarchy, we can associate a Möbius
transformation as well as a string of $D_{i}$ matrices whose eigenvalues
determine the asymptotic scaling. There is however an important distinction in
these two characterization of the self-similar hierarchy. As illustrated in
Fig. (13), two very distinct hierarchies, one describing a nested set of
circles while the other is a chain of circles, both exhibiting same scaling,
are represented by the same Möbius transformation. In contrast, within the
Apollonian group, these two hierarchies are respectively described by
$D_{3}^{2}D_{2}\equiv h_{3}h_{1}$ and $D_{2}D_{3}^{2}\equiv h_{1}h_{3}$. In
the first case, the nested set of circles exhibit self-similar kaleidoscopic
symmetries. In contrast, the $D_{2}D_{3}^{2}\equiv h_{1}h_{3}$ hierarchy does
not exhibit this special symmetry. These differences are reflected in the
eigenvectors of $h_{3}h_{1}$ and $h_{1}h_{3}$ which are respectively given by
$\left(\begin{array}[]{c}\sin\frac{\pi}{6}\\\ \cos\frac{\pi}{6}\\\
\end{array}\right)$ and $\left(\begin{array}[]{c}\sin\frac{\pi}{12}\\\
\cos\frac{\pi}{12}\\\ \end{array}\right)$.

##  IX  Conclusion

Apollonian circle packing as described here using various number theoretical
and geometrical properties, relates this fascinating fractal to the Ford
circles, the Farey tree that generates all rationals as well as the the
Pythagorean tree for generating primitive Pythagorean triplets. The entire
framework can be described elegantly using Möbius transformations and the
group theory involving special linear groups $SL(2,C)$ , $SL(2,Z)$ and the
Apollonian group. The central result of this paper, that the self-similar
properties of the entire Apollonian gasket are encoded in the Ford circles,
can be visualized geometrically due to various kaleidoscopic symmetries of the
gasket as shown in Table (1) and further illustrated in Fig. (9). The self-
similar recursions associated with the packing are given by a Möbius map (9)
forming a modular group $SL(2,Z)$, characterized by the matrix
$\mathcal{F^{*}}$ whose eigenvalues describe the asymptotic scalings.
Intriguingly, a very special family of irrational numbers are found to be
lurking in the self-similar scaling factors. Number theory unites this family,
revealing its special elite status as its members, identified with a single
integer $n$ can be represented by $[n+1:\overline{1,n}]$. It includes the
golden-mean class, that is a group of irrationals with continued fraction
representation $[n;\overline{1}]$ as the golden mean is
$\frac{1+\sqrt{5}}{2}=[1;\overline{1}]$. It excludes the silver mean class,
namely the irrationals with continued fraction expansion as
$[n;\overline{2}]$.

As a final comment, we would like to point out that the proof of the Descartes
theorem for the Ford circles stated in the form of the property of the
homogeneous functions as described in Appendix B sets the stage for an
alternative proof of the Descartes theorem that is more elegant than the
previously known proofs of the theoremJ1 . This is because the Descartes
configurations for Ford circles are related to an arbitrary Descartes
configuration via a conformal transformation.

##  Appendix A  Möbius Transformations

Conformal maps are functions in complex plane that preserve the angles between
curves. There is a specific family of conformal maps $w=\frac{az+b}{cz+d}$,
known as Möbius transformation or linear fractional transformation. Such
transformation maps lines and circles to lines and circles. These maps can be
represented ( denoted by symbol $\dot{=}$ ) with a matrix: The map

$w=f(z)=\frac{az+b}{cz+d}\,\ \dot{=}\,\ \left(\begin{array}[]{cc}a&b\\\ c&d\\\
\end{array}\right)$ (45)

This identification of Möbius map with a matrix is useful because if we
consider two conformal maps: $w_{1}=f_{1}(z)$ and $w_{2}=f_{2}(z)$ that
respectively correspond to the matrices $C_{1}$ and $C_{2}$. Then the
composition $f_{1}f_{2}(z)$ corresponds to the matrix $C_{1}\cdot C_{2}$.

The constants of Mobius maps $(a,b,c,d)$ can be determinedwiki in terms of two
sets of triplets: $(z_{1},z_{2},z_{3})$ and their conformal image
$(w_{1},w_{2},w_{3})$:

$\displaystyle a$ $\displaystyle=$
$\displaystyle\det{\left(\begin{array}[]{ccc}z_{1}w_{1}&w_{1}&1\\\
z_{2}w_{2}&w_{2}&1\\\ z_{3}w_{3}&w_{3}&1\end{array}\right)},\,\
b=\det{\left(\begin{array}[]{ccc}z_{1}w_{1}&z_{1}&w_{1}\\\
z_{2}w_{2}&z_{2}&w_{2}\\\ z_{3}w_{3}&z_{3}&w_{3}\end{array}\right)}$ (52)
$\displaystyle c$ $\displaystyle=$
$\displaystyle\det{\left(\begin{array}[]{ccc}z_{1}&w_{1}&1\\\ z_{2}&w_{2}&1\\\
z_{3}&w_{3}&1\end{array}\right)},\,\
d=\det{\left(\begin{array}[]{ccc}z_{1}w_{1}&z_{1}&1\\\ z_{2}w_{2}&z_{2}&1\\\
z_{3}w_{3}&z_{3}&1\end{array}\right)}$ (59)

In other words, there is a unique map that connects two distinct set of
triplets. Since any three points determine a configuration of four mutually
tangent circles), as illustrated in Fig. (2), any two Descartes configurations
are related by a Möbius map. These relations are consequence of the invariance
of “cross-ratio”,
$R=\frac{(z_{4}-z_{1})(z_{2}-z_{3})}{(z_{2}-z_{1})(z_{4}-z_{3})}$. It turns
out that the self-similar hierarchies that share a boundary circle correspond
to real value of $R$ that remains invariant as we zoom in the recursive
structure.

##  Appendix B  Descartes’s Theorem for Ford Circles

Theorem: If three variables $\lambda_{1}$, $\lambda_{2}$ and $\lambda_{3}$ are
related by,

$\lambda_{1}+\lambda_{2}+\lambda_{3}=0$ (60)

Then they also satisfy,

$(\lambda
1^{2}+\lambda_{2}^{2}+\lambda_{3}^{2})^{2}=2(\lambda_{1}^{4}+\lambda_{2}^{4}+\lambda_{3}^{4}).$
(61)

Proof: Define the standard three homogeneous symmetric polynomials on three
variables,

$\displaystyle S_{1}=\lambda_{1}+\lambda_{2}+\lambda_{3},\,\,\
S_{2}=\lambda_{1}\lambda_{2}+\lambda_{2}\lambda_{3}+\lambda_{3}\lambda_{2},\,\,\
S_{3}=\lambda_{1}\lambda_{2}\lambda_{3},$ (62)

and some additional ones that will be useful,

$\displaystyle T_{2}=\lambda_{1}^{2}+\lambda_{2}^{2}+\lambda_{3}^{2},\,\,\
T_{4}=\lambda_{1}^{4}+\lambda_{2}^{4}+\lambda_{3}^{4},\,\,\
U=\lambda_{1}^{2}\lambda_{2}^{2}+\lambda_{2}^{2}\lambda_{3}^{2}+\lambda_{3}^{2}\lambda_{2}^{2}$
(63)

By direct multiplication, we have,

$\displaystyle S_{1}^{2}=T_{2}+2S_{2},\,\,\ T_{2}^{2}=T_{4}+2U,\,\,\
S_{2}^{2}=U+2S_{1}S_{3}.$ (64)

We now set $S_{1}=0$, that gives $T_{2}=-2S_{2}$. Squaring both sides, and
then eliminating U we get,

$\displaystyle T_{2}^{2}=4S_{2}^{2}=4U=2T_{2}^{2}-2T_{4}=2T_{4}$ (65)

$T_{2}^{2}=2T_{4}$ gives the required equation ( 61). Applying the above
formulas for the Farey relation $q_{c}=q_{R}+q_{L}$, we get the Descartes
theorem for Ford circles.

## References

  * (1) D. Mackenzie, Am. Sci. 98 ( 2010 ) 10.
  * (2) Ronald.Graham,Jeffrey C.Lagarias, Colin L.Mallows, Allan R. Wilks and Catherine H. Yan, Apollonian circle packings: geometry and group theory I. Apollonian group, Discrete and Computational Geometry 34 (2005), 547–585; Ronald L. Graham, Jeffrey C. Lagarias, Colin L. Mallows, Allan R. Wilks and Catherine H. Yan, Apollonian circle packings: number theory, J. Number Theory 100 (2003), 1–45.
  * (3) Ogilvy, C. S. (1990). Excursions in Geometry. Dover. pp. 54 D 55. ISBN 0-486-26530-7; Also see, <https://en.wikipedia.org/wiki/Mobius_transformation>
  * (4) Peter Sarnak, “Integral Apollonian Packings”, The American Mathematical Monthly 118(4), March $2011$.
  * (5) Jerzy Kocik, Proof of Descartes circle formula and its generalization, clarified (arXiv:0706.0372).
  * (6) Jerzy Kocik, On a Diophantine equation that generates all integral Apollonian gaskets, ISRN Geometry, 348618 (2012).
  * (7) Hofstadter, D R, 1976, Energy-levels and Wave-functions for Bloch electrons in Rational and Irrational Magnetic Fields, Phys.Rev.B, 14, 2239-49.
  * (8) Thouless, D J , Kohmoto M, Nightingale M P and den Nijs M, 1982, Quantised Hall Conductance in a Two-Dimensional Periodic Potential, Phys. Rev. Lett., 49, 405-8.
  * (9) I. I. Satija, Butterfly in the Quantum World (IOP Concise, Morgan and Claypool, San Raffael, CA, 2016), Chap. 10.
  * (10) I.I. Satija, J. Phys. A: Math. Theor. 54 ( 2021), 025701.
  * (11) I. I. Satija, 2016, A tale of two fractals: The Hofstadter butterfly and the integral Apollonian gaskets, Eur. Phys. J. - Special Topics, 225, 2533-47.
  * (12) I. Satija and M. Wilkinson, “Nests and chains of Hofstadter butterflies”, J. Phys A , 53, 085703, 2020.
  * (13) Using $C_{1}$ as the origin and $C1C2$ as the $x$-axis, the coordinates $(x_{4},y_{4})$ of the center of the outermost circle of curvature $\kappa_{4}$ is given by, $x_{4}=\frac{1}{\kappa_{1}}-\frac{\kappa_{2}-\kappa_{1}}{\kappa_{4}(\kappa_{1}+\kappa_{2})},\,\,\ y_{4}^{2}=(\frac{(\kappa_{1}-\kappa_{4}}{\kappa_{1}\kappa_{4}})^{2}+x_{4}^{2}$. Also, given the curvatures of the three circles, the sides of the triangles are $(r_{1}+r_{2}),(r_{1}+r_{3}),(r_{2}+r_{3})$ where $r_{i}=\frac{1}{\kappa_{i}}$.
  * (14) Ogilvy, C. S. (1990). Excursions in Geometry. Dover. pp. 54 D 55. ISBN 0-486-26530-7.
  * (15) L. R. Ford, The American Mathematical Monthly, Vol. 45, No. 9 ( 1938) 586-601.
  * (16) This proof is by Richard Friedberg ( private communication) July 2017.
  * (17) Satija, I I, 2018, Pythagorean Triplets, Integral Apollonians and The Hofstadter Butterfly, arXiv:1802.04585v3 [nlin.CD]
  * (18) A. Hall, Geneology of Pythagorean Triads, Math. Gazette 54, No. 390 (1970), 377-379.
  * (19) Jerzy Kocik, Adv. Appl. Clifford alg. 17 (2007), 793.
  * (20) R. C. Alperin, $PSL2(Z)=Z2*Z3$, Amer. Mathematical Monthly 100 (1993), 385–386.