Sunday, June 14, 2026
HomeLanguagesnumpy.angle() in Python

numpy.angle() in Python

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 tan-1(x/y).

Syntax : numpy.angle(z, deg=0)

Parameters :
z : [array_like] A complex number or sequence of complex numbers.
deg : [bool, optional] Return angle in degrees if True, radians if False (default).

Return :
angle : The counterclockwise angle from the positive real axis on the complex plane, with dtype as numpy.float64.

Code #1 : Working




# Python program explaining
# numpy.angle() function
# when we want answer in radian
  
import numpy as geek
in_list =[2.0, 1.0j, 1 + 1j]
  
print ("Input  list : ", in_list)
    
out_angle = geek.angle(in_list) 
print ("output angle in radians : ", out_angle) 


Output :

Input  list :  [2.0, 1j, (1+1j)]
output angle in radians :  [ 0.          1.57079633  0.78539816]

 
Code #2 : Working




# Python program explaining
# numpy.angle() function
# when we want answer in degrees
  
import numpy as geek
in_list =[2.0, 1.0j, 1 + 1j]
  
print ("Input  list : ", in_list)
    
out_angle = geek.angle(in_list, deg = True
print ("output angle in degrees : ", out_angle) 


Output :

Input  list :  [2.0, 1j, (1+1j)]
output angle in degrees :  [  0.  90.  45.]
RELATED ARTICLES

2 COMMENTS

Most Popular

Dominic
32515 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6897 POSTS0 COMMENTS
Nicole Veronica
12013 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12109 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6964 POSTS0 COMMENTS