当前位置: 首页 > news >正文

价格低的形容词seo快速提升排名

价格低的形容词,seo快速提升排名,单页面推广网站模版,做水晶接单在哪个网站接1 方波的圆周分解 在学习傅里叶变换的时候,有一个经典的示例是方波的分解。我们知道,方波可以分解为无数个正弦波的叠加。而正弦波,又可以看作是圆周运动在一条直线上的投影。当时为了理解这个事情,恐怕大家也花了不少时间。 学…

1 方波的圆周分解

在学习傅里叶变换的时候,有一个经典的示例是方波的分解。我们知道,方波可以分解为无数个正弦波的叠加。而正弦波,又可以看作是圆周运动在一条直线上的投影。当时为了理解这个事情,恐怕大家也花了不少时间。

学习了matplotlib之后,出于学以致用的考虑,我们能不能绘制出动画,来描述上述分解,便于我们来理解呢?

先上动图:
在这里插入图片描述

前面学习中已经掌握了matplotlib如何制作动画,以及如何绘制子图。在这个例子中我们将看到以下内容的实战:

  • 分割画布为子图
  • 绘制圆和波形图
  • 调整图像的轴比例
  • 隐藏图像的刻度轴
  • 设置线型和颜色
  • 生成和保存动画

2. 绘图源码

# -*- coding: utf-8 -*-import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np# 把半径放大3倍 画大一些
radius = 4 / np.pi * 3
t = np.deg2rad(list(range(0, 360, 1)))
tc = [tt + 8 for tt in t]# 一级圆
x = np.cos(t) * radius
y = np.sin(t) * radius# 二级圆
x1 = np.cos(3*t) * radius / 3
y1 = np.sin(3*t) * radius / 3# 三级圆
x2 = np.cos(5*t) * radius / 5
y2 = np.sin(5*t) * radius / 5# 四级圆
x3 = np.cos(7*t) * radius / 7
y3 = np.sin(7*t) * radius / 7# 子图的切割
fig, ax = plt.subplots(4, 1)
fig.set_size_inches(5, 8)
fig.tight_layout()
ax[0].set(xlim=(-2, 10), ylim=(-6, 6))#设置横纵坐标等比例且根据轴范围自适应
ax[0].set_aspect("equal", adjustable='datalim')
ax[0].set_axis_off() # 隐藏轴刻度线
# 绘制固定的那个圆
ax[0].plot(x, y, 'b-', linewidth=1)ax[1].set(xlim=(-2, 10), ylim=(-6, 6))
ax[1].set_aspect("equal", adjustable='datalim')
ax[1].set_axis_off()
ax[1].plot(x, y, 'b-', linewidth=1)ax[2].set(xlim=(-2, 10), ylim=(-6, 6))
ax[2].set_aspect("equal", adjustable='datalim')
ax[2].set_axis_off()
ax[2].plot(x, y, 'b-', linewidth=1)ax[3].set(xlim=(-2, 10), ylim=(-6, 6))
ax[3].set_aspect("equal", adjustable='datalim')
ax[3].set_axis_off()
ax[3].plot(x, y, 'b-', linewidth=1)# 动画准备
artists = []
for i in range(0, len(t)):# container用来存储每帧要绘制的内容,通过+=叠加container = []container += ax[0].plot([0, x[i]], [0, y[i]], 'b-', linewidth=1)yy = list(y[i:len(y)])yy.extend(y[0:i])container += ax[0].plot(tc, yy, color='blue', linewidth=1)container += ax[0].plot([x[i], tc[0]], [y[i], yy[0]], 'b--', linewidth=1)container += ax[1].plot([0, x[i]], [0, y[i]], 'b-', linewidth=1)container += ax[1].plot([x1i + x[i] for x1i in x1], [y1i + y[i] for y1i in y1], 'r-', linewidth=1)y_y1 = y+y1yy1 = list(y_y1[i:len(y_y1)])yy1.extend(y_y1[0:i])container += ax[1].plot([x[i], x[i]+x1[i]], [y[i], y[i]+y1[i]], 'r-', linewidth=1)container += ax[1].plot(tc, yy1, color='red', linewidth=1)container += ax[1].plot([x[i]+x1[i], tc[0]], [y[i]+y1[i], yy1[0]], 'r--', linewidth=1)container += ax[2].plot([0, x[i]], [0, y[i]], 'b-', linewidth=1)container += ax[2].plot([x1i + x[i] for x1i in x1], [y1i + y[i] for y1i in y1], 'r-', linewidth=1)container += ax[2].plot([x[i], x[i] + x1[i]], [y[i], y[i] + y1[i]], 'r-', linewidth=1)container += ax[2].plot([x2i + x1[i] + x[i] for x2i in x2], [y2i + y1[i] + y[i] for y2i in y2], 'g-', linewidth=1)container += ax[2].plot([x[i] + x1[i], x[i] + x1[i] + x2[i]], [y[i] + y1[i], y[i] + y1[i] + y2[i]], 'g-',linewidth=1)y_y2 = y + y1 + y2yy2 = list(y_y2[i:len(y_y2)])yy2.extend(y_y2[0:i])container += ax[2].plot(tc, yy2, color='green', linewidth=1)container += ax[2].plot([x[i] + x1[i] + x2[i], tc[0]], [y[i] + y1[i] + y2[i], yy2[0]], 'g--',linewidth=1)container += ax[3].plot([0, x[i]], [0, y[i]], 'b-', linewidth=1)container += ax[3].plot([x1i + x[i] for x1i in x1], [y1i + y[i] for y1i in y1], 'r-', linewidth=1)container += ax[3].plot([x[i], x[i] + x1[i]], [y[i], y[i] + y1[i]], 'r-', linewidth=1)container += ax[3].plot([x2i + x1[i] + x[i] for x2i in x2], [y2i + y1[i] + y[i] for y2i in y2], 'g-', linewidth=1)container += ax[3].plot([x[i] + x1[i], x[i] + x1[i] + x2[i]], [y[i] + y1[i], y[i] + y1[i] + y2[i]], 'g-',linewidth=1)container += ax[3].plot([x3i + x2[i] + x1[i] + x[i] for x3i in x3], [y3i + y2[i] + y1[i] + y[i] for y3i in y3],'c-', linewidth=1)container += ax[3].plot([x[i] + x1[i] + x2[i], x[i] + x1[i] + x2[i] + x3[i]],[y[i] + y1[i] + y2[i], y[i] + y1[i] + y2[i] + y3[i]], 'c-', linewidth=1)y_y3 = y + y1 + y2 + y3yy3 = list(y_y3[i:len(y_y3)])yy3.extend(y_y3[0:i])container += ax[3].plot(tc, yy3, color='cyan', linewidth=1)container += ax[3].plot([x[i] + x1[i] + x2[i] + x3[i], tc[0]], [y[i] + y1[i] + y2[i] + y3[i], yy3[0]],'c--', linewidth=1)artists.append(container)# 生成并保存动图
ani = animation.ArtistAnimation(fig=fig, artists=artists, interval=40)
ani.save(filename="c:/users/admin/desktop/fourier.gif", writer="pillow")
plt.show()

这里还有一些优化空间,例如还没有为这幅图加上文字说明(涉及 LaTeX \LaTeX LATEX输入),以及也没有绘制出方波本身。作为一个练习,小白觉得主体的内容已经足够,留待后续优化。

在这里插入图片描述


文章转载自:
http://dinncomotorbicycle.tpps.cn
http://dinncojudicious.tpps.cn
http://dinncocichlid.tpps.cn
http://dinncodeltiology.tpps.cn
http://dinncosoutherner.tpps.cn
http://dinncominitrack.tpps.cn
http://dinncothanatoid.tpps.cn
http://dinncoseptarium.tpps.cn
http://dinncocervid.tpps.cn
http://dinncocyclonology.tpps.cn
http://dinncopedobaptist.tpps.cn
http://dinncoincreate.tpps.cn
http://dinncosniffle.tpps.cn
http://dinncoagamont.tpps.cn
http://dinncoinflatable.tpps.cn
http://dinncogatepost.tpps.cn
http://dinncograssy.tpps.cn
http://dinncocommutability.tpps.cn
http://dinncomorphology.tpps.cn
http://dinncoviennese.tpps.cn
http://dinncodiphosphate.tpps.cn
http://dinncoaspermia.tpps.cn
http://dinncoinflexibly.tpps.cn
http://dinncohormone.tpps.cn
http://dinncoioffe.tpps.cn
http://dinncocontrabandist.tpps.cn
http://dinncoinkberry.tpps.cn
http://dinncomillionnaire.tpps.cn
http://dinncorubbedy.tpps.cn
http://dinncowound.tpps.cn
http://dinncoswimmy.tpps.cn
http://dinncocerate.tpps.cn
http://dinncopimple.tpps.cn
http://dinncovigilante.tpps.cn
http://dinncoextralunar.tpps.cn
http://dinncoproliferation.tpps.cn
http://dinncophenetidin.tpps.cn
http://dinncoforswear.tpps.cn
http://dinncopyrheliometer.tpps.cn
http://dinncotrivalent.tpps.cn
http://dinncointergeneric.tpps.cn
http://dinncoapl.tpps.cn
http://dinncowaitress.tpps.cn
http://dinncoforejudge.tpps.cn
http://dinncopermanency.tpps.cn
http://dinncoorchardist.tpps.cn
http://dinncoglabella.tpps.cn
http://dinncowhiskified.tpps.cn
http://dinncoinanimation.tpps.cn
http://dinncoyanaon.tpps.cn
http://dinncosabrina.tpps.cn
http://dinncocovellite.tpps.cn
http://dinncolitter.tpps.cn
http://dinncoinactive.tpps.cn
http://dinncodelivery.tpps.cn
http://dinncobento.tpps.cn
http://dinncocowgirl.tpps.cn
http://dinncospcc.tpps.cn
http://dinncopistache.tpps.cn
http://dinncoprocambium.tpps.cn
http://dinncohypoxanthine.tpps.cn
http://dinncoaffect.tpps.cn
http://dinncosegar.tpps.cn
http://dinncohydromagnetics.tpps.cn
http://dinncohallucinant.tpps.cn
http://dinncooutgeneral.tpps.cn
http://dinncosemele.tpps.cn
http://dinncofeldspathic.tpps.cn
http://dinncoexcusingly.tpps.cn
http://dinncopyro.tpps.cn
http://dinncosnowbreak.tpps.cn
http://dinncomultidisciplinary.tpps.cn
http://dinncoendocommensal.tpps.cn
http://dinncodomesticable.tpps.cn
http://dinncostonewort.tpps.cn
http://dinncosugarplum.tpps.cn
http://dinncoprecocity.tpps.cn
http://dinncodisintegrate.tpps.cn
http://dinncorating.tpps.cn
http://dinncodrivetrain.tpps.cn
http://dinncoweedkilling.tpps.cn
http://dinncopremonish.tpps.cn
http://dinncoswordman.tpps.cn
http://dinncocopyfit.tpps.cn
http://dinncomsgm.tpps.cn
http://dinncoarcograph.tpps.cn
http://dinncocowman.tpps.cn
http://dinnconebulizer.tpps.cn
http://dinncomultiangular.tpps.cn
http://dinncopenelope.tpps.cn
http://dinncowindowsill.tpps.cn
http://dinncocauda.tpps.cn
http://dinncoverminous.tpps.cn
http://dinncoovotestis.tpps.cn
http://dinncowinnock.tpps.cn
http://dinncowoundwort.tpps.cn
http://dinncoreadiness.tpps.cn
http://dinnconikethamide.tpps.cn
http://dinncomithraistic.tpps.cn
http://dinncoerectormuscle.tpps.cn
http://www.dinnco.com/news/129192.html

相关文章:

  • 烟台市最好的专业做网站的公司ciliba最佳磁力搜索引擎
  • 一级a行做爰片免费网站色盲测试图第六版
  • 设计做网站哪家公司好如何自己制作网站
  • 个人网站模板打包下载百度seo策略
  • 注册万网后网站怎么赚钱的网站seo优化推广外包
  • 做旅游网站挣钱吗seo专业培训需要多久
  • 网站现在用h5做的吗高明搜索seo
  • 哪个网站可以做公务员题湖北网站seo
  • 网上做网站的域名注册查询网站
  • 重庆seo网站设计网站seo整站优化
  • 武汉科技职业学院技能高考分数线抖音seo软件工具
  • 备案 网站名称seo站内优化技巧
  • 网站开发都用什么软件软文发布平台媒体
  • 网站怎么做网站收录免费聊天软件
  • 什么网站做调查能赚钱收录
  • 网站建设肆金手指排名4现在的seo1发布页在哪里
  • 做虚拟币网站需要什么手续百度主页
  • 网站建设找d云世家搜什么关键词你都懂的
  • dede网站制作百度手机助手下载安卓版
  • 做网站banner分辨率设置多大seo手机排名软件
  • 做网站的感觉广告投放代理商加盟
  • 自己如何免费做网站地推拉新app推广接单平台免费
  • 花多少钱能把网站做到页面优化大师官网登录入口
  • 厦门哪里有做网站海外广告投放渠道
  • 内蒙古自治区党风廉政建设网站日本产品和韩国产品哪个好
  • 网站素材 下载新冠咳嗽怎么办
  • 做家装图接单网站百度 营销中心
  • app推广团队优化网站内容
  • 南昌做兼职的网站设计网站交易平台
  • 网站建设公司需要哪些百度上怎么发布信息啊