I would like to use the two functions pol2cart and cart2pol present in MATLAB.
Are there any equivalent Python functions? Or if we can define the functions?
For instance, I tried using cmath.polar function but it only accepts one argument whereas I have 2 arguments to be passed inside polar and rec function.
I have tried using this function for cart2pol:
def cart2pol(x, y):
theta = atan2(y, x)
rho = sqrt(x**2 + y**2)
return (theta, rho)
Thank you