carg (?) bug



Alexey Beshenov pisze:
> On Sunday 11 January 2009 15:48:09 Adam Majewski wrote:
>> Hi,
>>
>> I make complex number in exponential form :
>> R:16;
>> T:1/3;
>> Z:R*exp(T*%i*2*%pi);
>>
>> output is :
>> 16*((sqrt(3)*%i)/2-1/2)
>>
>> Then check radius :
>>
>> r:abs(Z)
>>   16
>>
>> it is good , but carg :
>>
>> (%i6) t:carg(Z)
>> (%o6) (2*%pi)/3
>>
>> It gives 2/3 not 1/3 .
>> Is it a bug ?
> 
> No. Complex argument of z is defined as angle \theta
> (-\pi < \theta <= \pi) such that z = |z| exp (\theta i).
> 
> So is is clear that carg(R*exp(T*%i*2*%pi)) = 2*%pi*T.
> 

You are right. It's my bug. (:-(
Sorry.
it should be :

carg_t(z):=carg(z)/(2*%pi); /* argument of complex number in  turns */
R:16;
T:1/3;
Z:R*exp(T*%i*2*%pi);
r:abs(Z);
t:carg_t(Z);
z:r*exp(t*%i*2*%pi);

S