本文整理汇总了Python中turtle.circle函数的典型用法代码示例。如果您正苦于以下问题:Python circle函数的具体用法?Python circle怎么用?Python circle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了circle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: displaySqaure
def displaySqaure(x, y):
turtle.penup()
turtle.goto(x - 100, y - 100)
turtle.pendown()
turtle.begin_fill()
turtle.circle(50, steps=4)
turtle.end_fill()
示例2: polygon
def polygon(side = 50, angle = None, xstart = None, ystart = None, numberSides = 3, color = 'black', fill = False):
turtle.pensize(3)
turtle.speed('fastest')
turtle.hideturtle()
if angle != None:
turtle.left(angle)
turtle.penup()
if fill == True:
if xstart != None or ystart != None:
turtle.goto(xstart, ystart)
else:
turtle.goto(0, 0)
turtle.color(color)
turtle.pendown()
turtle.begin_fill()
turtle.circle(side, 360, numberSides)
turtle.end_fill()
turtle.penup()
else:
turtle.goto(xstart, ystart)
turtle.color(color)
turtle.pendown()
turtle.circle(side, 360, numberSides)
turtle.penup()
return
示例3: hang
def hang():
turtle.speed(0)
if stage[0]==0:
go_to(-300,0,0)
turtle.forward(600)
go_to(-100,0, 90)
turtle.forward(200)
turtle.right(90)
turtle.forward(100)
turtle.right(90)
turtle.forward(25)
elif stage[0]==1:
go_to(0, 150, 0)
turtle.circle(12.5)
elif stage[0]==2:
go_to(0,150, -90)
turtle.forward(50)
elif stage[0]==3:
go_to(0,140, -45)
turtle.forward(25)
go_to(0,140, -135)
turtle.forward(25)
elif stage[0]==4:
go_to(0,100, -45)
turtle.forward(25)
go_to(0,100, -135)
turtle.forward(25)
stage[0]+=1
return 0
示例4: rand_circle
def rand_circle():
color = choice(colors)
turtle.color(color, color)
radius = randint(10, 100)
turtle.begin_fill()
turtle.circle(radius)
turtle.end_fill()
示例5: circle
def circle(x,y,size):
turtle.pu()
turtle.goto(x,y)
turtle.pd()
turtle.begin_fill()
turtle.circle(size)
turtle.end_fill()
示例6: circle
def circle(a,b):
turtle.color("green")
turtle.pu()
turtle.goto(a,b)
turtle.pd()
turtle.setheading(90)
turtle.circle(40)
示例7: drawCircleAt
def drawCircleAt(turtleX, turtleY, circleSize):
turtle.penup()
turtle.goto(turtleX,turtleY)
turtle.pendown()
turtle.begin_fill()
turtle.circle(circleSize)
turtle.end_fill()
示例8: stam
def stam(x,y):
turtle.begin_fill()
turtle.pu()
turtle.goto(x,y)
turtle.pd()
turtle.circle(10)
turtle.end_fill()
示例9: draw
def draw(self):
turtle.forward(self.radius)
turtle.left(90)
turtle.circle(self.radius, extent=self.angle)
turtle.left(90)
turtle.forward(self.radius)
turtle.done()
示例10: drawCircle
def drawCircle(x = 0, y = 0, radius = 10, mycolor = (0.49, 0.99, 0.00)): # Lawn Green
turtle.pencolor(mycolor[0], mycolor[1], mycolor[2])
turtle.pensize(4)
turtle.penup()
turtle.goto(x, y - radius)
turtle.pendown()
turtle.circle(radius)
示例11: drawFlower
def drawFlower(xCenter = 0, yCenter = 0, xRightUp = 0, yRightUp = 0,
xRightDown = 0, yRightDown = 0, xLeftUp = 0, yLeftUp = 0,
xLeftDown = 0, yLeftDown = 0, radius = 10):
turtle.pensize(3)
turtle.color(1.0, 0.41, 0.70) # Hot Pink
turtle.penup()
turtle.goto(xCenter, yCenter - radius)
turtle.pendown()
turtle.circle(radius)
turtle.penup()
turtle.goto(xRightUp, yRightUp - radius)
turtle.pendown()
turtle.circle(radius)
turtle.penup()
turtle.goto(xRightDown, yRightDown - radius)
turtle.pendown()
turtle.circle(radius)
turtle.penup()
turtle.goto(xLeftUp, yLeftUp - radius)
turtle.pendown()
turtle.circle(radius)
turtle.penup()
turtle.goto(xLeftDown, yLeftDown - radius)
turtle.pendown()
turtle.circle(radius)
示例12: draw_move
def draw_move(turtle, cell_size, offset, domino, dx, dy, move_num, step_count):
shade = (move_num-1) * 1.0/step_count
rgb = (0, 1-shade, shade)
turtle.forward((domino.head.x-offset[0]) * cell_size)
turtle.left(90)
turtle.forward((domino.head.y-offset[1]) * cell_size)
turtle.right(90)
turtle.setheading(domino.degrees)
turtle.forward(cell_size*.5)
turtle.setheading(math.atan2(dy, dx) * 180/math.pi)
pen = turtle.pen()
turtle.pencolor(rgb)
circle_pos = turtle.pos()
turtle.width(4)
turtle.forward(cell_size*0.05)
turtle.down()
turtle.forward(cell_size*0.4)
turtle.up()
turtle.pen(pen)
turtle.setpos(circle_pos)
turtle.forward(8)
turtle.setheading(270)
turtle.forward(8)
turtle.left(90)
turtle.down()
turtle.pencolor(rgb)
turtle.fillcolor('white')
turtle.begin_fill()
turtle.circle(8)
turtle.end_fill()
turtle.pen(pen)
turtle.write(move_num, align='center')
turtle.up()
示例13: display
def display(self):
turtle.penup()
print(self.x, self.y)
turtle.goto(self.x,self.y)
turtle.pendown()
turtle.circle(self.r)
turtle.penup()
示例14: drawPoint
def drawPoint(x, y):
turtle.penup()
turtle.goto(x, y)
turtle.pendown()
turtle.begin_fill()
turtle.circle(3)
turtle.end_fill()
示例15: drawEyes
def drawEyes():
"""
Draw the pair of eyes.
:pre: (relative) pos (0,0), heading (east), up
:post: (relative) pos (0,0), heading (east), up
:return: None
"""
# left eye
turtle.forward(10)
turtle.left(90)
turtle.forward(10)
turtle.right(90)
turtle.down()
turtle.begin_fill()
turtle.circle(5)
turtle.end_fill()
turtle.up()
# right eye
turtle.forward(30)
turtle.down()
turtle.begin_fill()
turtle.circle(5)
turtle.end_fill()
turtle.up()
# return back
turtle.back(30)
turtle.left(90)
turtle.back(10)
turtle.right(90)
turtle.back(10)