摘要:文章目錄中秋福利中秋月餅鴨代碼展示鴨中秋福利今天中秋節(jié)了,給大家安排一波中秋福利鴨,再這里祝大家中秋快樂鴨,有朋友陪伴的和朋友開心得玩鴨,有家人陪伴的好好和家人快樂鴨,沒有人陪伴的,來找鴨。
今天中秋節(jié)了,給大家安排一波中秋福利鴨,pier再這里祝大家中秋快樂鴨,有朋友陪伴的和朋友開心得玩鴨,有家人陪伴的好好和家人快樂鴨,沒有人陪伴的,來找pier鴨。pier教你畫月餅,學會了,國慶畫點花花給自己的女神表白鴨!
注:本篇文章采用python寫的,博主也是多年不用python,看在博主早上6點不到就起來調(diào)試的份上,給博主留下你的小贊可好!
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條邊上花紋第一個參數(shù)為不同地方的圓心,第二個與第三個圓心為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再祝大家中秋快樂鴨
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://m.specialneedsforspecialkids.com/yun/119995.html
摘要:可以看到在元的月餅銷量是反常的,說明這個價格比較受人們歡迎。高檔的月餅在臨近中秋節(jié)會買的越來越好,這符合人們的消費習慣。下一步重點研究買的好的店鋪,天貓超市與稻香村食品旗艦店,票券票務十年老店主要是賣月餅劵,后面會說到。 造數(shù)帶你選月餅,點擊這里,過節(jié)再也不擔憂 showImg(https://segmentfault.com/img/remote/1460000011412184);...
摘要:知曉推送能幫助小程序運營人員有效解決粉絲轉(zhuǎn)化消息推送數(shù)據(jù)分析等多個層面的麻煩事,讓小程序推廣難留存差的問題從此成為過去式。開不開心鴨活動時間月日月日新人專享注冊即得活動期間通過下方鏈接注冊的新用戶,即可獲得元優(yōu)惠券及條模板消息。 showImg(https://cloud-minapp-11491.cloud.ifanrusercontent.com/1hOa5rGXckkDGJUv....
摘要:文字有點長,對于不想看文字的朋友,可以去這里看視頻,內(nèi)容和這個文字一樣的,視頻可能更好理解面向過程概述所謂面向過程,及關(guān)注過程面向的字面意思就是關(guān)注著眼于面對著那么什么是過程呢過程就是過程,也可以理解為步驟當我們做某件事情的時候,如果關(guān)注過 文字有點長,對于不想看文字的朋友,可以去這里看視頻,內(nèi)容和這個文字一樣的,視頻可能更好理解 https://www.piqizhu.com/v/...
小黃鴨調(diào)試法 場景一:我們都有過向別人(甚至可能向完全不會編程的人)提問及解釋編程問題的經(jīng)歷,但是很多時候就在我們解釋的過程中自己卻想到了問題的解決方案,然后對方卻一臉茫然。 場景二:你的同行跑來問你一個問題,但是當他自己把問題說完,或說到一半的時候就想出答案走了,留下一臉茫然的你。 其實上面兩種場景現(xiàn)象就是所謂的小黃鴨調(diào)試法(Rubber Duck Debuging),又稱橡皮鴨調(diào)試法,它是我們...
閱讀 2526·2021-09-26 10:18
閱讀 3399·2021-09-22 10:02
閱讀 3209·2019-08-30 15:44
閱讀 3336·2019-08-30 15:44
閱讀 1841·2019-08-29 15:25
閱讀 2587·2019-08-26 14:04
閱讀 2052·2019-08-26 12:15
閱讀 2449·2019-08-26 11:43