A conceptually simpler formula is to compute the arc of the circle between tangent circles in the ring. Then the sum of these angles is 2π. Of course, this is not an algebraic equation, but could be made algebraic via the application of trig identities.