\(c^2-2ac+a^2+2ab-2bc=a^2\)
\(\Rightarrow\left(a-c\right)^2+2b\left(a-c\right)=a^2\)
\(c^2-2bc+b^2+2a\left(b-c\right)=b^2\Rightarrow\left(b-c\right)^2+2a\left(b-c\right)=b^2\)
\(\Rightarrow B=\frac{\left(a-c\right)^2+2b\left(a-c\right)+\left(a-c\right)^2}{\left(b-c\right)^2+2a\left(b-c\right)+\left(b-c\right)^2}=\frac{2\left(a-c\right)\left(a-c+b\right)}{2\left(b-c\right)\left(b-c+a\right)}=\frac{a-c}{b-c}\)