Simplificar[ p_]  :=  
      Simplify[(p/PolynomialGCD)[p[[1]], p[[2]], p[[3]]]]

Unir[{x1_, y1_, z1_}, {x2_, y2_, z2_}] :=
Simplificar[{Det[(({{y1, z1}, {y2, z2}}))],-Det[(({{x1, z1}, {x2, z2}}))],Det[(({{x1, y1}, {x2, y2}}))]}]

SA = (((b^2) + (c^2) - (a^2))/2); SB = (((c^2) + (a^2) - (b^2))/2); 
    SC = (((a^2) + (b^2) - (c^2))/2);
CuadradoDistancia[{u_, v_, w_}, {x_, y_, 
          z_}]  := (1/((((u + v + 
                      w))^2) (((x + y + z))^2))) (SA ((((v + w) x - u (y + z)))^2) + SB ((((w + u) y - v (z + x)))^2) + 
            SC ((((u + v) z - w (x + y)))^2))

ptI = {a, b, c};
ptT = {a + b - c, 0, b + c - a};
rtBC = ptA = {1, 0, 0};
rtAB = ptC = {0, 0, 1};

rtIT = Unir[ptI, ptT];
ptN = Unir[rtIT, rtBC];
ptM = Unir[rtIT, rtAB];

IM2  =  CuadradoDistancia[ptI, ptM];
IN2 = CuadradoDistancia[ptI, ptN];
r2 = CuadradoDistancia[ptI, ptT];
Factor[1/IM2 + 1/IN2 - 1/r2]