All you need to do is just to give 3 circles. Then this program finds all circles touching the given circles.
Download the program (This is a C# program. You need to compile it locally,):
https://github.com/lechatthecat/ApolloniusCirclesDrawer
The essence of the code is described in Rosetta code:
http://rosettacode.org/wiki/Problem_of_Apollonius#C.23
About why this calculation finding the solution circles, read algebraic solution, probelm of apollonius, Wikipedia.
http://rosettacode.org/wiki/Problem_of_Apollonius#C.23
About why this calculation finding the solution circles, read algebraic solution, probelm of apollonius, Wikipedia.