绘制玫瑰花

Posted 洛小飞0803

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了绘制玫瑰花相关的知识,希望对你有一定的参考价值。

import turtle
turtle.setup(1000,800,200,200)
turtle.speed(5)
turtle.begin_fill()
turtle.circle(40,60)
turtle.seth(120)
turtle.circle(40,50)
turtle.left(15)
turtle.circle(40,80)
turtle.left(15)
turtle.circle(30,50)
turtle.left(10)
turtle.circle(30,60)
turtle.right(5)
turtle.fd(20)
turtle.speed(20)
turtle.circle(30,100)
turtle.left(10)
turtle.circle(70,110)
turtle.right(5)
turtle.fd(10)
turtle.left(20)
turtle.fd(50)
turtle.seth(120)  #1
turtle.fd(30)
turtle.seth(-120)
turtle.circle(160,125)
turtle.seth(25)
turtle.circle(160,60)
turtle.circle(160,50)
turtle.fd(25)      #2
turtle.seth(-120)
turtle.speed(30)
turtle.fd(35)
turtle.seth(110)
turtle.circle(80,35)
turtle.color("red")
turtle.end_fill()
turtle.pencolor("black")
turtle.seth(-75)
turtle.fd(80)
turtle.seth(56)
turtle.circle(60,45)
turtle.seth(-100)
turtle.penup()
turtle.fd(45)
turtle.pendown()
turtle.seth(-160)
turtle.circle(90,90)
turtle.fd(50)
turtle.circle(60,60)
turtle.seth(90)
turtle.speed(10)
turtle.circle(200,48)
turtle.penup()
turtle.fd(100)
turtle.seth(-150)
turtle.fd(12)
turtle.pendown()
turtle.seth(-80)
turtle.circle(80,90)
turtle.penup()
turtle.seth(-68)
turtle.fd(158)
turtle.pendown()
turtle.circle(200,90)
turtle.penup()
turtle.seth(170)
turtle.fd(210)
turtle.seth(45)
turtle.speed(40)
turtle.pendown()
turtle.fd(20)
turtle.begin_fill()
turtle.seth(15)
turtle.circle(90,90)
turtle.seth(-165)
turtle.circle(90,90)
turtle.color("green")
turtle.end_fill()
turtle.penup()
turtle.seth(180)
turtle.fd(30)
turtle.pendown()
turtle.fd(20)
turtle.begin_fill()
turtle.seth(165)
turtle.circle(90,90)
turtle.seth(-15)
turtle.circle(90,90)
turtle.color("green")
turtle.end_fill()
turtle.seth(180)
turtle.circle(40,60)
turtle.done()

 

以上是关于绘制玫瑰花的主要内容,如果未能解决你的问题,请参考以下文章

用代码写出浪漫__合集(pythonmatplotlibMatlabjava绘制爱心玫瑰花前端特效玫瑰爱心)

玫瑰花的绘制

MATLAB表白玫瑰花绘制——旋转玫瑰蓝色玫瑰

python表白玫瑰花绘制——情人节表白

python表白玫瑰花绘制——情人节表白

数据可视化应用绘制风玫瑰图(附Python代码)