A C library for calculating the complex impedance of an AC circuit