파이썬 cmath.polar() 메서드
예시
복소수를 극좌표 형식으로 변환:
#import cmath for complex number operations
import cmath
#find
the polar coordinates of complex number
print (cmath.polar(2 + 3j))
print (cmath.polar(1 + 5j))
정의 및 사용
이 cmath.polar()
방법은 복소수를 극좌표로 변환합니다. 모듈러스와 위상의 튜플을 반환합니다.
극좌표에서 복소수는 계수 r 및 위상각 phi 로 정의됩니다 .
통사론
cmath.polar(x)
매개변수 값
Parameter | Description |
---|---|
x | Required. A number to find polar coordinates of |
기술적 세부 사항
반환 값: | tuple 극좌표를 나타내는 값 |
---|---|
파이썬 버전: | 2.6 |