将极坐标转换为笛卡尔坐标(0-360 度)

Converting Polar to Cartesian coordinates (0-360 degrees)

我目前正在使用以下代码将笛卡尔 (x, y) 坐标转换为角度(0-360 度):

def anti_clockwise(x,y):
    alpha = degrees(atan2(y,x))
    return (alpha + 360) % 360

我现在试图通过指定一个距离(例如,100)和角度(从上面的代码得出)到 return 到一些 x,y 坐标来返回。

我已经能够使用简单的三角函数让它工作,但这仅限于 0-90 度。有什么方法可以获取整个 0-360 度范围内的 x、y 坐标吗?

以下是我正在使用的,但我意识到我没有转换回弧度!

def get_coord(magnitude, degrees):
    angle = radians(degrees)
    x = magnitude * cos(angle)
    y = magnitude * sin(angle)
    return x, y

以下内容已经过测试并且可以正常工作:

def get_coord(magnitude, degrees):
    angle = radians(degrees)
    x = magnitude * cos(angle)
    y = magnitude * sin(angle)
    return x, y

问题是在计算角度时没有转换为弧度。