python表白玫瑰花绘制——情人节表白

python表白玫瑰花绘制——情人节表白,第1张

概述python表白玫瑰花绘制——情人节表白搬运不易,路过的各位大佬请点个赞————————————————版权声明:本文主要参考CSDN博主「sunie」的文章,参考博文链接:https://blog.csdn.net/weixin_43387647/article/details/88973568python表白玫瑰花绘制——情人节表 python表白玫瑰花绘制——情人节表白

搬运不易,路过的各位大佬请点个赞
————————————————
版权声明:本文主要参考CSDN博主「sun IE」的文章,
参考博文链接:https://blog.csdn.net/weixin_43387647/article/details/88973568

python表白玫瑰花绘制——情人节表白python表白玫瑰花绘制——情人节表白一、玫瑰花绘制一二、玫瑰花绘制二三、玫瑰花绘制三四、桃花绘制

一、玫瑰花绘制一

fig = plt.figure()ax = fig.gca(projection='3d')[x, t] = np.meshgrID(np.array(range(25)) / 24.0, np.arange(0, 575.5, 0.5) / 575 * 30 * np.pi - 4*np.pi)p = (np.pi / 2) * np.exp(-t / (8 * np.pi))change = np.sin(20*t)/50u = 1 - (1 - np.mod(3.3 * t, 2 * np.pi) / np.pi) ** 4 / 2 + changey = 2 * (x ** 2 - x) ** 2 * np.sin(p)r = u * (x * np.sin(p) + y * np.cos(p)) * 1.5h = u * (x * np.cos(p) - y * np.sin(p))c= cm.get_cmap('magma')surf = ax.plot_surface(r * np.cos(t), r * np.sin(t), h, rstrIDe=1, cstrIDe=1,                       cmap= c, linewidth=0, antialiased=True)plt.show()
二、玫瑰花绘制二

fig = plt.figure()ax = fig.gca(projection='3d')[x, t] = np.meshgrID(np.array(range(25)) / 24.0, np.arange(0, 575.5, 0.5) / 575 * 6 * np.pi - 4*np.pi)p = (np.pi / 2) * np.exp(-t / (8 * np.pi))change = np.sin(10*t)/20u = 1 - (1 - np.mod(5.2 * t, 2 * np.pi) / np.pi) ** 4 / 2 + changey = 2 * (x ** 2 - x) ** 2 * np.sin(p)r = u * (x * np.sin(p) + y * np.cos(p)) * 1.5h = u * (x * np.cos(p) - y * np.sin(p))c= cm.get_cmap('spring_r')surf = ax.plot_surface(r * np.cos(t), r * np.sin(t), h, rstrIDe=1, cstrIDe=1,                       cmap= c, linewidth=0, antialiased=True)plt.show()
三、玫瑰花绘制三

# 省略了头文件,可以在之前的博客里看到fig = plt.figure()ax = fig.gca(projection='3d')# 将相位向后移动了6*pi[x, t] = np.meshgrID(np.array(range(25)) / 24.0, np.arange(0, 575.5, 0.5) / 575 * 20 * np.pi + 4*np.pi)p = (np.pi / 2) * np.exp(-t / (8 * np.pi))# 添加边缘扰动change = np.sin(15*t)/150# 将t的参数减少,使花瓣的角度变大u = 1 - (1 - np.mod(3.3 * t, 2 * np.pi) / np.pi) ** 4 / 2 + changey = 2 * (x ** 2 - x) ** 2 * np.sin(p)r = u * (x * np.sin(p) + y * np.cos(p))h = u * (x * np.cos(p) - y * np.sin(p))c= cm.get_cmap('Reds')surf = ax.plot_surface(r * np.cos(t), r * np.sin(t), h, rstrIDe=1, cstrIDe=1,                       cmap= c, linewidth=0, antialiased=True)plt.show()
四、桃花绘制

fig = plt.figure()ax = fig.gca(projection='3d')[x, t] = np.meshgrID(np.array(range(25)) / 24.0, np.arange(0, 575.5, 0.5) / 575 * 6 * np.pi - 4*np.pi)p = (np.pi / 2) * np.exp(-t / (8 * np.pi))change = np.sin(10*t)/20u = 1 - (1 - np.mod(5.2 * t, 2 * np.pi) / np.pi) ** 4 / 2 + changey = 2 * (x ** 2 - x) ** 2 * np.sin(p)r = u * (x * np.sin(p) + y * np.cos(p)) * 1.5h = u * (x * np.cos(p) - y * np.sin(p))c= cm.get_cmap('spring_r')surf = ax.plot_surface(r * np.cos(t), r * np.sin(t), h, rstrIDe=1, cstrIDe=1,                       cmap= c, linewidth=0, antialiased=True)plt.show()
总结

以上是内存溢出为你收集整理的python表白玫瑰花绘制——情人节表白全部内容,希望文章能够帮你解决python表白玫瑰花绘制——情人节表白所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1185795.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-03
下一篇 2022-06-03

发表评论

登录后才能评论

评论列表(0条)

保存