The generalized version of Ptolemy's theorem, also known, as Casey's theorem states the following.
Theorem. Let O be a circle of radius R. Let O1,O2,O3,O4 be (in that order) four non-intersecting circle that lie inside O and tangent to it. Denote by tij the length of the exterior common tangent of the circles Oi,Oj. Then, t12⋅t34+t41⋅t23=t13⋅t24.
Think about why this is a generalized case of Ptolemy's theorem. When is Ptolemy's Theorem a special case of this?
In the degenerate case, where all four circles reduce to points, this is exactly Ptolemy's theorem.
Denote the radius of circle Oi by Ri and its tangency point with the circle O by Ki. We will use the notation O, Oi for the centers of the circles. Note, from the Pythagorean Theorem, that tij2=(OiOj)2−(Ri−Rj)2. We will try to express this length in terms of the points Ki,Kj. By the law of cosines on triangle OiOOj, we have (OiOj)2=(OOi)2+(OOj)2−2(OOi)⋅(OOj)⋅cos∠OiOOj.Since the circles O and Oi are tangent to each other, we find that OOi=R−Ri and ∠OiOOj=∠KiOKj. Let C be a point on the circle O. According to the law of sines on triangles KiCKj, we have KiKj=2R⋅sin∠KiCKj=2R⋅sin2∠KiOKj. Therefore, cos∠KiOKj=1−2sin22∠KiOKj=1−2⋅(2RKiKj)2=1−2R2(KiKj)2.
Substituting and simplifying, you should get (OiOj)2=((R−Ri)−(R−Rj))2+(R−Ri)(R−Rj)⋅R2(KiKj)2.And eventually, after much algebra, we find that tij=(OiOj)2−(Ri−Rj)2=RR−Ri⋅R−Rj⋅(KiKj) and in fact, the left-hand-side in the original theorem becomes t12t34+t14t23=R21⋅R−R1⋅R−R2⋅R−R3⋅R−R4⋅((K1K3)⋅(K2K4))=t13t24,as desired. ■
Exercise for the reader. Verify the steps we skipped and make sure you understand where everything comes from!