我很难创建一个简单的函数,用sympy来增加圆心的X值。我的代码是:
test_center=Point (1,2)
test_circle = Circle (test_center, 1)
def travel (circle, distance):
circle.center.x += distance
return circle.center.x
travel (test_circle,1)
print(test_circle)
我要说的是:
16号线,行驶中
circle.center.x += distance AttributeError: can't set attribute
任何帮助都将不胜感激!在
无法分配变量
circle.center.x
,如果要移动圆,请使用translate函数:相关问题 更多 >
编程相关推荐