#劉任昌教python設窗程式設計 from tkinter import * #從函式庫 tkinter 輸入所有 * 方法 from math import * #從函式庫 math 輸入所有 * 方法 class Regular: #定義類別Regular正多邊形或星型 def __init__(self, cx, cy, cr, s, t, c, w): #類別共同的設定 self.cx, self.cy, self.cr = cx, cy, cr #取得中心座標cx, cy, 半徑cr self.s, self.t = s, t #取得邊角數目s,t尖銳程度,取代原來的k = s.get() self.c, self.w = c, w #取得顏色c,寬度w self.u = 2 * pi / self.s #使用模組 math 圓周率 pi self.x, self.y = [], [] for i in range( int(self.s * 1.5)): self.x.append(self.cx + self.cr*cos(i*self.u)) self.y.append(self.cy + self.cr*sin(i*self.u)) def draw(self): #類別的方法 for i in range( int(self.s * 1.5) - self.t): canvas.create_line(self.x[i], self.y[i], self.x[i + self.t], self.y[i + self.t], fill = self.c, width = self.w) def show(): #畫圖 poly = Regular(cx.get(), cy.get(), cr.get(), s.get(), t.get(), c.get(), w.get()) ...
作者已經移除這則留言。
回覆刪除D11017218
回覆刪除https://d11017218.blogspot.com/2024/03/1.html
D11017157
回覆刪除https://takming12345.blogspot.com/2024/03/037excelmatchindex.html
D11017257
回覆刪除https://takming123.blogspot.com/2024/03/1.html
D11017140
回覆刪除https://d11017140.blogspot.com/2024/03/037excelmatchindex.html
d11036108
回覆刪除https://20020927.blogspot.com/2024/03/201720.html
D11017202 https://draft.blogger.com/blog/post/edit/preview/6174802439427569065/8613294704144930027
回覆刪除D11017237
回覆刪除https://gold-1-2zhang842.blogspot.com/2024/03/202441.html
D11017242
回覆刪除https://d11017242takming.blogspot.com/2024/03/excelmatchindex.html
D11017243
回覆刪除https://yan911222.blogspot.com/2024/03/d11017243.html?sc=1711944799821#c6244125072251629642
D11017239
回覆刪除https://zxcv0218.blogspot.com/2024/03/excelmatchindex.html
D11017108
回覆刪除https://jia-0909.blogspot.com/2024/04/excelmatchindex.html
D11017312
回覆刪除https://stephen-ky.blogspot.com/2024/04/2024415-d11017312.html
https://stephen-ky.blogspot.com/2024/04/037excelmatchindex.html
回覆刪除D11017311陳佑愷
回覆刪除https://danley1116.blogspot.com/2024/04/excelmatchindex.html