Python--四个不同方向的半圆

需注意的地方

t.penup()#抬笔
t.pendown()#落笔
t.goto(x,y)#x,y分别为横坐标和纵坐标,表示将笔移到(x,y)这个位置上,通过改变x,y可以改变图形的位置,海龟作图的笔默认位置为(0,0)

#位置正确,方向为上左下右

import turtle
import turtle as t
t.width(5)
t.penup()
t.goto(-240,150)
t.pendown()
t.color('black')
t.right(90)
t.circle(60,180)
t.penup()
t.goto(-70,90)
t.pendown()
t.color('red')
t.right(90)
t.circle(60,180)
t.penup()
t.goto(140,100)
t.pendown()
t.color('yellow')
t.right(90)
t.circle(60,180)
t.penup()
t.goto(240,200)
t.pendown()
t.color('blue')
t.right(90)
t.circle(60,180)

#位置对齐了,半圆的方向分别为上,左,右,下

import turtle
import turtle as t
t.width(5)
t.penup()
t.goto(-240,150)
t.pendown()
t.color('black')
t.right(90)
t.circle(60,180)
t.penup()
t.goto(-70,90)
t.pendown()
t.color('red')
t.right(90)
t.circle(60,180)
t.penup()
t.goto(70,210)
t.pendown()
t.color('yellow')
#t.right(90)
t.circle(60,180)
t.penup()
t.goto(240,120)
t.pendown()
t.color('blue')
t.left(90)
#t.right(90)
t.circle(60,180)

#此时位置为沿坐标轴x,y轴对称

import turtle
import turtle as t
t.width(5)
t.penup()
t.goto(-150,150)
t.pendown()
t.color('black')
t.right(90)
t.circle(60,180)
t.penup()
t.goto(150,90)
t.pendown()
t.color('red')
t.right(90)
t.circle(60,180)
t.penup()
t.goto(-100,-90)
t.pendown()
t.color('yellow')
#t.left(90)
t.circle(60,180)
t.penup()
t.goto(240,-150)
t.pendown()
t.color('blue')
t.left(90)
t.circle(60,180)
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值