编写程序画出以下图形,包括直角坐标系,圆半径是50,三角形ABC是等腰直角三角形,AB平行x轴。
以下是参考代码:
import turtle turtle.fd(300);turtle.stamp();turtle.bk(600);turtle.fd(300);turtle.left(90) turtle.fd(300);turtle.stamp();turtle.bk(600);turtle.fd(300);turtle.right(90) r = 100 turtle.pensize(2) turtle.penup() turtle.fd(r) turtle.left(90) turtle.pendown() turtle.circle(r) turtle.penup() turtle.circle(r,45) C = turtle.position() turtle.dot(10,'blue') turtle.circle(r,-90) B = turtle.position() turtle.dot(10,'red') turtle.circle(r,-90) A = turtle.position() turtle.dot(10,'green') turtle.pendown() turtle.goto(C);turtle.goto(B);turtle.goto(A) turtle.ht() turtle.done()
发表评论