파이썬 cmath.rect() 메서드
예시
극좌표를 직사각형 형태로 변환:
#import cmath for complex number operations
import cmath
#convert
a polar coordinate to rectangular form
print(cmath.rect(3.1622776601683795, 1.2490457723982544))
정의 및 사용
이 cmath.rect()
방법은 극좌표를 복소수의 직사각형 형태로 변환합니다. 위상과 계수가 있는 복소수를 생성합니다.
이 방법은 에 해당합니다 r * (math.cos(phi) +
math.sin(phi)*1j)
.
참고: 반경 r 은 벡터의 길이이고 phi (위상 각도)는 실제 축과 이루는 각도입니다.
통사론
cmath.rect(r, phi)
매개변수 값
Parameter | Description |
---|---|
r | Required. Represents the modulus of a complex number |
phi | Required. Represents the phase of a complex number |
기술적 세부 사항
반환 값: | complex 복소수의 직사각형 형태를 나타내는 값 |
---|---|
파이썬 버전: | 2.6 |