atan2(x,x)



Barton Willis wrote:
> -----Raymond Toy <toy.raymond at gmail.com> wrote: -----
> 
> 
>> How is atan2 defined for non-real arguments?
>>
>> Ray
> 
> x + %i * y = sqrt(x^2 + y^2) * exp(%i * atan2(y,x)), so
> atan2(y,x) = -%i*log((y+%i*x)/sqrt(y^2+x^2)). From what
> I can tell, Maple and Mathematica are the same as Maxima:

Yes, this makes sense.  It's also the definition on
functions.wolfram.com, where I should have looked first.  Sorry for the
noise.

> 
>  (%i1) logarc(atan2(x,y));
>  (%o1) -%i*log((y+%i*x)/sqrt(y^2+x^2))
> 
> The SBCL atan function rejects non-real arguments.

All Lisps should reject it since the spec explicitly says the two arg
form only accepts real arguments.

Ray