That's a great answer from a programer's perspective. Unfortunately, mathematically, it is not as perfect as it could be. The 100% correct answer is "(-1+1j)", per Euler's identity (ref. https://en.wikipedia.org/wiki/Euler%27s_formula). This is very basic and important math in electrical engineering, btw. I think the workaround would be something along the lines of: adjust all angles between 0 and 90 in degrees, then adjust math/cmath sin/cos results accordingly.