# Computing atan2(x,y) - Hewlett Packard

This is a discussion on Computing atan2(x,y) - Hewlett Packard ; A recent post here (iirc) asked about computing atan2(x,y), the inverse tan of y/x in the proper quadrant. The current issue of The College Mathematics Journal has an article by William Freed and Athanasios Tavouktsoglou with the following formula: atan2(x,y) ...

1. ## Computing atan2(x,y)

inverse tan of y/x in the proper quadrant.

The current issue of The College Mathematics Journal has an article by
William Freed and Athanasios Tavouktsoglou with the following formula:

atan2(x,y) = 2*atan(y/(x+sqrt(x^2+y^2)) except for x<0 and y=0;
pi for x<0 and y=0.

This might be of use.

2. ## Re: Computing atan2(x,y)

On Mar 5, 4:26 pm, mjc wrote:
> inverse tan of y/x in the proper quadrant.
>
> The current issue of The College Mathematics Journal has an article by
> William Freed and Athanasios Tavouktsoglou with the following formula:
>
> atan2(x,y) = 2*atan(y/(x+sqrt(x^2+y^2)) except for x<0 and y=0;
> pi for x<0 and y=0.
>
> This might be of use.

all HP calculators deal perfectly with this issue.
RTFM

3. ## Re: Computing atan2(x,y)

On Mar 5, 5:24*am, reth wrote:
> On Mar 5, 4:26 pm, mjc wrote:
>
> > A recent post here (iirc) asked about computing atan2(x,y), the
> > inverse tan of y/x in the proper quadrant.

>
> > The current issue of The College Mathematics Journal has an article by
> > William Freed and Athanasios Tavouktsoglou with the following formula:

>
> > atan2(x,y) = 2*atan(y/(x+sqrt(x^2+y^2)) except for x<0 and y=0;
> > * * * * * * * * * *pi for *x<0 and y=0.

>
> > This might be of use.

>
> all HP calculators deal perfectly with this issue.
> RTFM

I am not sure I understand you. With what issue do HP calculators
"deal perfectly?"

It can't be with an atan2 function. There is none in the catalog on my
HP 50g, and the 49 AUR is of no help.
It can't be with atan2(-1, 0), per the formula given above, as it
results in "?".

= Secondary issue
I defined ATAN2 as described above, and attempted to construct
lim(ATAN2(X, 0), 0). CAS seems not to like user-specified functions.
Is this the case? How do people overcome this limitation? Recall the
variable and substitute 0 for Y?

-- F

4. ## Re: Computing atan2(x,y)

The HP 33S manual suggests using rectangular to polar conversion for
arctan(y/x).

5. ## Re: Computing atan2(x,y)

"Curtis A. Jones" writes:

> The HP 33S manual suggests using rectangular to polar conversion for
> arctan(y/x).

On the HP48, you can enter x and y, and then

R\->C ARG

This will return an ATAN in degrees if in degree mode, or in radians if

Scott
--
Scott Hemphill hemphill@alumni.caltech.edu
"This isn't flying. This is falling, with style." -- Buzz Lightyear

6. ## Re: Computing atan2(x,y)

On Wed, 05 Mar 2008 12:51:33 -0600, Scott Hemphill wrote:

> On the HP48, you can enter x and y, and then
>
> R\->C ARG

All HP48/49/50 have these same "user" commands.

[r->] [OFF]