Python倒圆(乌龟)

2024-06-23 19:45:59 发布

您现在位置:Python中文网/ 问答频道 /正文

如何在Python中只使用turtle绘制一个倒圆?i、 顺时针画的圆,而不是传统的逆时针画圆。在

现在的海龟在垂直向下线的底部。。。如何从那里画出指定的圆?在


Tags: 绘制传统海龟turtle逆时针顺时针画圆
2条回答
x=turtle.Turtle()
x.right(90)
x.forward(100)
x.right(90)
x.circle(100)

你对自己问题的回答是不完整的。你在问题中明确指出:

a circle which is drawn clockwise rather than the traditional way of drawing one anticlockwise

因此,更好的解决方案是:

x = turtle.Turtle()
x.right(90)
x.forward(100)
x.left(90)
x.circle(-100)

根据documentation

Draw the arc in counterclockwise direction if radius is positive, otherwise in clockwise direction.

相关问题 更多 >

    热门问题