摘要:文章目录中秋福利中秋月饼鸭代码展示鸭中秋福利今天中秋节了,给大家安排一波中秋福利鸭,再这里祝大家中秋快乐鸭,有朋友陪伴的和朋友开心得玩鸭,有家人陪伴的好好和家人快乐鸭,没有人陪伴的,来找鸭。
今天中秋节了,给大家安排一波中秋福利鸭,pier再这里祝大家中秋快乐鸭,有朋友陪伴的和朋友开心得玩鸭,有家人陪伴的好好和家人快乐鸭,没有人陪伴的,来找pier鸭。pier教你画月饼,学会了,国庆画点花花给自己的女神表白鸭!
注:本篇文章采用python写的,博主也是多年不用python,看在博主早上6点不到就起来调试的份上,给博主留下你的小赞可好!
from numpy import sin, cos, piimport matplotlib.pyplot as pltfrom matplotlib.patches import Arc, Circle, Wedgelength = 20R = 3**0.5*length/(3**0.5*cos(pi/12)-sin(pi/12))r = 2*sin(pi/12)*R/3**0.5# 12条边上花纹第一个参数为不同地方的圆心,第二个与第三个圆心为rarc1 = Arc([0, length], width=2*r, height=2*r, angle=0, theta1=30, theta2=150, ec="brown", linewidth=4)arc2 = Arc([-length/2, length/2*3**0.5], width=2*r, height=2*r, angle=0, theta1=60, theta2=180, ec="brown", linewidth=4)arc3 = Arc([-length/2*3**0.5, length/2], width=2*r, height=2*r, angle=0, theta1=90, theta2=210, ec="brown", linewidth=4)arc4 = Arc([-length, 0], width=2*r, height=2*r, angle=0, theta1=120, theta2=240, ec="brown", linewidth=4)arc5 = Arc([-length/2*3**0.5, -length/2], width=2*r, height=2*r, angle=0, theta1=150, theta2=270, ec="brown", linewidth=4)arc6 = Arc([-length/2, -length/2*3**0.5], width=2*r, height=2*r, angle=0, theta1=180, theta2=300, ec="brown", linewidth=4)arc7 = Arc([0, -length], width=2*r, height=2*r, angle=0, theta1=210, theta2=330, ec="brown", linewidth=4)arc8 = Arc([length/2, -length/2*3**0.5], width=2*r, height=2*r, angle=0, theta1=240, theta2=360, ec="brown", linewidth=4)arc9 = Arc([length/2*3**0.5, -length/2], width=2*r, height=2*r, angle=0, theta1=270, theta2=390, ec="brown", linewidth=4)arc10 = Arc([length, 0], width=2*r, height=2*r, angle=0, theta1=300, theta2=420, ec="brown", linewidth=4)arc11 = Arc([length/2*3**0.5, length/2], width=2*r, height=2*r, angle=0, theta1=330, theta2=450, ec="brown", linewidth=4)arc12 = Arc([length/2, length/2*3**0.5], width=2*r, height=2*r, angle=0, theta1=0, theta2=120, ec="brown", linewidth=4)art_list = [arc1, arc2, arc3, arc4, arc5, arc6, arc7, arc8, arc9, arc10, arc11, arc12]circle = Circle((0,0), R, ec="orange", fc="white", linewidth=4)wedge1 = Wedge([-2, 2], R-5, 90, 180, ec="brown", fc=r"white", linewidth=4)wedge2 = Wedge([-5, 5], R-12, 90, 180, ec="brown", fc=r"white", linewidth=4)wedge3 = Wedge([-2, -2], R-5, 180, 270, ec="brown", fc=r"white", linewidth=4)wedge4 = Wedge([-5, -5], R-12, 180, 270, ec="brown", fc=r"white", linewidth=4)wedge5 = Wedge([2, -2], R-5, 270, 360, ec="brown", fc=r"white", linewidth=4)wedge6 = Wedge([5, -5], R-12, 270, 360, ec="brown", fc=r"white", linewidth=4)wedge7 = Wedge([2, 2], R-5, 0, 90, ec="brown", fc=r"white", linewidth=4)wedge8 = Wedge([5, 5], R-12, 0, 90, ec="brown", fc=r"white", linewidth=4)# 将这些图形加入画布中鸭,用列表好读取鸭art_list.extend([circle, wedge1, wedge2, wedge3, wedge4, wedge5, wedge6, wedge7, wedge8])fig, ax = plt.subplots(figsize=(8,8))plt.rcParams["font.family"]="SimHei"ax.set_aspect("equal")for a in art_list: ax.add_patch(a)plt.text(-14, -1.0, "happy mid-Autumn", fontfamily=r"Times New Man", bbox=dict(boxstyle="square", fc="w", ec="brown", linewidth=4), fontsize=20, color="brown")plt.title("pier~")plt.ylim([-35, 35])plt.xlim([-35, 35])plt.show()
最后pier再祝大家中秋快乐鸭
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/119995.html
摘要:可以看到在元的月饼销量是反常的,说明这个价格比较受人们欢迎。高档的月饼在临近中秋节会买的越来越好,这符合人们的消费习惯。下一步重点研究买的好的店铺,天猫超市与稻香村食品旗舰店,票券票务十年老店主要是卖月饼劵,后面会说到。 造数带你选月饼,点击这里,过节再也不担忧 showImg(https://segmentfault.com/img/remote/1460000011412184);...
摘要:知晓推送能帮助小程序运营人员有效解决粉丝转化消息推送数据分析等多个层面的麻烦事,让小程序推广难留存差的问题从此成为过去式。开不开心鸭活动时间月日月日新人专享注册即得活动期间通过下方链接注册的新用户,即可获得元优惠券及条模板消息。 showImg(https://cloud-minapp-11491.cloud.ifanrusercontent.com/1hOa5rGXckkDGJUv....
摘要:文字有点长,对于不想看文字的朋友,可以去这里看视频,内容和这个文字一样的,视频可能更好理解面向过程概述所谓面向过程,及关注过程面向的字面意思就是关注着眼于面对着那么什么是过程呢过程就是过程,也可以理解为步骤当我们做某件事情的时候,如果关注过 文字有点长,对于不想看文字的朋友,可以去这里看视频,内容和这个文字一样的,视频可能更好理解 https://www.piqizhu.com/v/...
小黄鸭调试法 场景一:我们都有过向别人(甚至可能向完全不会编程的人)提问及解释编程问题的经历,但是很多时候就在我们解释的过程中自己却想到了问题的解决方案,然后对方却一脸茫然。 场景二:你的同行跑来问你一个问题,但是当他自己把问题说完,或说到一半的时候就想出答案走了,留下一脸茫然的你。 其实上面两种场景现象就是所谓的小黄鸭调试法(Rubber Duck Debuging),又称橡皮鸭调试法,它是我们...
阅读 2469·2021-09-26 10:18
阅读 3325·2021-09-22 10:02
阅读 3139·2019-08-30 15:44
阅读 3293·2019-08-30 15:44
阅读 1789·2019-08-29 15:25
阅读 2549·2019-08-26 14:04
阅读 2008·2019-08-26 12:15
阅读 2413·2019-08-26 11:43