为什么 turtle.circle(r,extent=720,steps=5) 在 python 中画了一颗星?
why does turtle.circle(r,extent=720,steps=5) in python draws a star?
今天无意中测试了这段代码:
import turtle
turtle.circle(70,extent=720,steps=5)
乌龟为我画了这个:
有人知道为什么会这样吗?
turtle.circle
不画圆。正如官方文档中的documented,
the circle is approximated by an inscribed regular polygon
指定extent=720
表示绘制720度的(近似)圆,指定steps=5
表示使用5边形来近似圆。绕720度的5边正多边形是标准的5边星。
今天无意中测试了这段代码:
import turtle
turtle.circle(70,extent=720,steps=5)
乌龟为我画了这个:
有人知道为什么会这样吗?
turtle.circle
不画圆。正如官方文档中的documented,
the circle is approximated by an inscribed regular polygon
指定extent=720
表示绘制720度的(近似)圆,指定steps=5
表示使用5边形来近似圆。绕720度的5边正多边形是标准的5边星。