Calculating sinusoidal voltage of an AC current