1 /* Argument (angle) of complex z
8 -a -pi See note 3 below
33 1. Handles mixed polar and rectangular forms, e.g. 1 + exp(i pi/3)
35 2. Symbols in z are assumed to be positive and real.
37 3. Negative direction adds -pi to angle.
39 Example: z = (-1)^(1/3), mag(z) = 1/3 pi, mag(-z) = -2/3 pi
41 4. jean-francois.debroux reports that when z=(a+i*b)/(c+i*d) then
43 arg(numerator(z)) - arg(denominator(z))
45 must be used to get the correct answer. Now the operation is
83 if (isnegativenumber(p1
)) {
86 } else if (car(p1
) == symbol(POWER
) && equaln(cadr(p1
), -1)) {
91 } else if (car(p1
) == symbol(POWER
) && cadr(p1
) == symbol(E
)) {
95 } else if (car(p1
) == symbol(MULTIPLY
)) {
105 } else if (car(p1
) == symbol(ADD
)) {
125 if (isnegative(RE
)) {
128 subtract(); // quadrant 1 -> 3
130 add(); // quadrant 4 -> 2