n=\frac{d^2-a^2+E_x^2-C_x^2+E_y^2-C_y^2}{2(E_x-C_x)}