赞
踩
目录
李峋同款跳动的爱心-双爱心版完整代码来喽!
- import random
- from math import sin, cos, pi, log
- from tkinter import *
-
- # Constants
- IMAGE_ENLARGE = 11
- INNER_HEART_COLOR = "pink"
- OUTER_HEART_COLOR = ""
- SCATTER_BETA = 0.15
- SHRINK_RATIO = 15
- CURVE_RATIO = 10
- FRAME_DELAY = 160
- NUM_POINTS = 2000
- NUM_HALO_POINTS = 3000
- NUM_EDGE_DIFFUSION_POINTS = 3
- HALO_RANDOM_FACTOR = 14
-
- # Heart Parameters Class
- class HeartParameters:
- def __init__(self):
- self.points = set()
- self.edge_diffusion_points = set()
- self.center_diffusion_points = set()
- self.all_points = {}
-
- # Heart Function
- def heart_function(t, shrink_ratio=IMAGE_ENLARGE):
- x = 16 * (sin(t) ** 3)
- y = -(13 * cos(t) - 5 * cos(2 * t) - 2 * cos
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。