Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)

The formula f=arctan(ImZ/ReZ) and to implement this, there are two options:

Option 1 (atan):

ImZ=-4.593172163003

ImR=-4.297336384845

>>> z=y/x

>>> f1=math.atan(z)

>>> f1

0.8186613519278327

Option 2 (atan2)

>>> f=math.atan2(y,x)

>>> f

-2.3229313016619604

Why the results different?

1 Answer

0 votes
by (108k points)

Kindly be informed that Atan takes a single argument and Atan2 takes two parameters. The intention of using two parameters instead of one is to collect information on the signs of the inputs in order to return the proper quadrant of the computed angle, which is not achievable for the single-argument Atan.

Willing to Learn Python? Sign up for this Python online course by Intellipaat now.

Related questions

0 votes
1 answer
asked Dec 13, 2020 in Python by ashely (50.2k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked May 20, 2020 in Python by Sudhir_1997 (55.6k points)

Browse Categories

...