circle(半径,度数)
比如说想画一个半径为50的半圆的曲线,就可以用circle(50,180)来表示
如果想截取一个半径为100的圆中110°的部分,就可以用circle(100,110)来表示
若要更改方向,可以在开始绘制前,把setheading()里的参数设置为其他的度数,一般默认向右
也可以更改circle里的数值,正负代表方向
如果要画一个圆形曲线,可以重复:
forward(1)
left(1)
以上步骤,若要更改角度或者方向,可以把left改成right,或者更改left和forward的参数
- from turtle import*
- speed(10)
- color('red','pink')
-
- begin_fill()
- left(45)
- fd(100)
- circle(50,180)
- right(90)
- circle(50,180)
- fd(100)
- end_fill()
-
- done()
- from turtle import*
- speed(0)
-
- def move():
- for i in range(200):
- right(1)
- forward(1)
-
- color('red','pink')
-
- begin_fill()
- left(140)
- forward(111.65)
- move()
- left(120)
- move()
- forward(111.65)
- end_fill()
-
- done()