You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
331 B
Python

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

view plaincopy to clipboardprint?
import cmath
cn = complex(3,4)
# get polar coordinates
print("Polar Coordinates: ",cmath.polar(cn))
# polar to rectangular. Format for input is (length, angle in radians).
#Returns a complex number
cn1 = cmath.rect(2, cmath.pi)
print("Polar to rectangular: ",cn1)