numpy.angle() function is used when we want to compute the angle of the complex argument. A complex number is represented by “ x + yi ” where x and y are real number and
i= (-1)^1/2. The angle is calculated by the formula
Syntax : numpy.angle(z, deg=0)
z : [array_like] A complex number or sequence of complex numbers.
deg : [bool, optional] Return angle in degrees if True, radians if False (default).
angle : The counterclockwise angle from the positive real axis on the complex plane, with dtype as numpy.float64.
Code #1 : Working
Input list : [2.0, 1j, (1+1j)] output angle in radians : [ 0. 1.57079633 0.78539816]
Code #2 : Working
Input list : [2.0, 1j, (1+1j)] output angle in degrees : [ 0. 90. 45.]
- Reading Python File-Like Objects from C | Python
- Important differences between Python 2.x and Python 3.x with examples
- Python | Merge Python key values to list
- Python | Index of Non-Zero elements in Python list
- Python | Convert list to Python array
- Python | Add Logging to a Python Script
- Python | Add Logging to Python Libraries
- Python | Sort Python Dictionaries by Key or Value
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Visualizing O(n) using Python
- gcd() in Python
- pow() in Python
- Any & All in Python
- bin() in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.