reserve n for Nat;
reserve i for Integer;
reserve r,s,t for Real;
reserve An,Bn,Cn,Dn for Point of TOP-REAL n;
reserve L1,L2 for Element of line_of_REAL n;
reserve A,B,C for Point of TOP-REAL 2;
reserve D for Point of TOP-REAL 2;
reserve a,b,c,d for Real;

theorem Th60:
  A,C,B is_a_triangle & angle(A,C,B) < PI implies
  tan ((angle(B,A,C) - angle(C,B,A))/2)
  = cot (angle(A,C,B) / 2) * ((|.C-B.|-|.C-A.|) / (|.C-B.| + |.C-A.|))
  proof
    assume that
A1: A,C,B is_a_triangle and
A2: angle(A,C,B) < PI;
A3: A,C,B are_mutually_distinct by A1,EUCLID_6:20;
A4: A,B,C is_a_triangle by A1,MENELAUS:15;
    then
A5: (angle(B,A,C) - angle(C,B,A) <> PI & angle(B,A,C) - angle(C,B,A) <> -PI)
       by Th25,Th26;
    set alpha = (angle(B,A,C) - angle(C,B,A))/2,
        beta  = (angle(B,A,C) + angle(C,B,A))/2;
    angle(A,C,B) = PI - (angle(C,B,A) + angle(B,A,C)) by A1,A2,Th23;
    then
A8: beta = PI/2 - angle(A,C,B)/2;
    set a2 = angle(A,C,B) / 2;
A9: sin beta = cos a2 & cos beta = sin a2 by A8,SIN_COS:79;
A10: sin a2 <> 0 by A1,Th21;
A11: |.C-B.| + |.C-A.| <> 0
    proof
      |.C-B.| <> 0 & |.C-A.| <> 0 by A3,EUCLID_6:42;
      hence thesis;
    end;
    sin beta * cos alpha * (|.C-B.| - |.C-A.|) =
    sin alpha * cos beta * (|.C-B.| + |.C-A.|) by A3,Th58;
    then (|.C-B.| - |.C-A.|) * cos a2 * cos alpha / cos alpha
      = (|.C-B.| + |.C-A.|) * sin a2 * sin alpha / cos alpha by A9;
    then (|.C-B.| - |.C-A.|) * cos a2 * (cos alpha / cos alpha)
      = (|.C-B.| + |.C-A.|) * sin a2 * (sin alpha / cos alpha);
    then (|.C-B.| - |.C-A.|) * cos a2 * (1)
      = (|.C-B.| + |.C-A.|) * sin a2 * (sin alpha / cos alpha)
         by A5,A4,Th59,XCMPLX_1:60;
    then (|.C-B.| - |.C-A.|) * cos a2 / sin a2
      = (|.C-B.| + |.C-A.|) * tan alpha * sin a2 / sin a2;
    then (|.C-B.| - |.C-A.|) * (cos a2 / sin a2)
      = (|.C-B.| + |.C-A.|) * tan alpha * (sin a2 / sin a2)
     .= (|.C-B.| + |.C-A.|) * tan alpha * (1) by A10,XCMPLX_1:60;
    then tan alpha * (|.C-B.| + |.C-A.|) / (|.C-B.|+|.C-A.|)
      = cot a2 * (|.C-B.|-|.C-A.|) / (|.C-B.| + |.C-A.|);
    then tan alpha * ((|.C-B.| + |.C-A.|) / (|.C-B.|+|.C-A.|))
      = cot a2 * ((|.C-B.|-|.C-A.|) / (|.C-B.| + |.C-A.|));
    then tan alpha * (1) = cot a2 * ((|.C-B.|-|.C-A.|) / (|.C-B.| + |.C-A.|))
      by A11,XCMPLX_1:60;
    hence thesis;
  end;
