python图案代码⼤全_Python练习代码实例65-⼀个最优美的图
案
Python 练习实例65
题⽬:⼀个最优美的图案。
程序分析:⽆。涉恶案件上诉有改判的吗
程序源代码:#!/usr/bin/python网站开发与应用
# -*- coding: UTF-8 -*-
import math满屏爱心代码html
class PTS:
def __init__(self):
self.x = 0
self.y = 0
points = []
def LineToDemo():
from Tkinter import *
screenx = 400
screeny = 400
canvas = Canvas(width = screenx,height = screeny,bg = 'white')
AspectRatio = 0.85
MAXPTS = 15
h = screeny
w = screenx
xcenter = w / 2
ycenter = h / 2
radius = (h - 30) / (AspectRatio * 2) - 20
php自学step = 360 / MAXPTS常量微量元素口诀
angle = 0.0
for i in range(MAXPTS):
rads = angle * math.pi / 180.0
p = PTS()
p.x = xcenter + s(rads) * radius)
p.y = ycenter - int(math.sin(rads) * radius * AspectRatio)
angle += step
points.append(p)
xcenter + radius,ycenter + radius)
for i in range(MAXPTS):
for j in range(i,MAXPTS):python基础代码大全下载
mainloop()
if __name__ == '__main__':
LineToDemo()
以上实例输出结果为:
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论