Rewrote to fix VS2013 compilation errors

Assuming the complex numbers are in Cartesian form this should be identical in function to the prior function.