Computation of impedances seen by distance relays