function theta = Arg(z) // This is naive as it returns Arg(0) as 0 and not und
x = real(z);
y = imag(z);
theta = atan(y,x);
endfunction;

function theta = Arg2(z) // This is scilab way to do if statements
theta = %nan * ones(z);
index=(z ~= 0);
theta(index)=atan(imag(z(index)), real(z(index)) );
endfunction;

p1a = (1+2*%i)/(3-4*%i)+(2-%i)/(5*%i)
p1b = 5*%i/( (1-%i)*(2-%i)*(3-%i) )
p1c = (1 - %i)^4
p7a = Arg(%i/(-2-2*%i))
p7b = Arg((sqrt(3)-%i)^6)

Arg(0)
Arg2([-1, %i, 1, -%i, 0, 1+%i])
Arg2([-1, %i, 1, -%i, 0, 1+%i])/%pi

// conj is conjugate
// abs is modulus
// real is the real part
// imag is the imag part --- which is always real.
// atan(y,x) is the Arg(x+yi) and apparently 0 at the orgin.
