1
I’m having trouble passing a list of numbers that are in Cartesian coordinates (u,v) and need to convert to polar coordinates. I tried for the package cmath, as follows:
import cmath
cmath.polar(complex(media_v1,media_v2))
the name media_v1 corresponds to variable x, and media_v2 to variable y. Made the following mistake:
TypeError: complex() first argument must be a string or a number, not 'list'
Someone can help me do this with a number list and not just a number, each variable has 360 x values and 360 y values.
I got it, thank you very much. I’m in trouble now because with this code the theta angle is generated in radians and I needed a code that makes generate direct in degrees.
– user219748