
Define h=HB
Case 1) H in AC
a^2=h^2+(b-m)^2
c^2=h^2+m^2
a^2-c^2=b^2-2mb
Therefore a^2=b^2+c^2-2mb
Case 2) A in HC

- a^2=h^2+(b+m)^2
 - c^2=h^2+m^2
 - a^2-c^2=b^2+2mb
 - Therefore a^2=b^2+c^2+2mb
 

Define h=HB
Case 1) H in AC
a^2=h^2+(b-m)^2
c^2=h^2+m^2
a^2-c^2=b^2-2mb
Therefore a^2=b^2+c^2-2mb
Case 2) A in HC
