r.hankin at noc.soton.ac.uk
Wed Mar 29 08:58:52 CEST 2006
perhaps my original message wasn't so clear.
My point was that the documentation is inconsistent with the
How to remedy this?
(i) add a line to Trig.Rd along the lines of "atan2() will not work
if the first argument
is real and the second argument complex"
(ii) Modify atan2() so that it coerces the first argument to a
complex if necessary.
I'd prefer option (ii) but can't see a quick fix.
On 28 Mar 2006, at 19:52, Jeff Newmiller wrote:
> Robin Hankin wrote:
>> ?atan2 says that atan2(y,x)=atan(y/x) for x and y numeric or complex
>> Well, I would expect atan2(1,1i) to be equal to atan(-1i), but
>> Error in atan2(y, x) : Non-numeric argument to mathematical function
> Ravi Varadhan pointed out that you need to make both arguments complex
> to address the error message you obtained... but atan2 wasn't
> designed for complex arguments. I suspect that what you really want is
> to use the Arg function:
>  -1.570796
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
More information about the R-help