Javascript code to compute with complex and polar numbers