import numpy as npdt = 0.002y = (25.0, -10.0, -7.0) # Starting point (initial condition)pts, cols = [], []for t in np.linspace(0, 20, int(20 / dt)):# Integrate a funny differential equationdydt = np.array([-8 / 3.0 * y[0] + y[1] * y[2],-10.0 * (y[1] - y[2]),-y[1] * y[0] + 28.0 * y[1] - y[2]])y = y + dydt * dtc = np.clip([np.linalg.norm(dydt) * 0.005], 0, 1)[0] # color by speedcols.append([c, 0, 1-c])pts.append(y)from vtkplotter import Plotter, Line, Point, Points, settingssettings.renderPointsAsSpheres = False # render points as squaresscene = Plotter(title="Lorenz attractor", axes=1, verbose=0, bg="w")scene += Point(y, r=10, c="g") # end pointscene += Points(pts, r=3, c=cols)scene += Line(pts).off().addShadow(x=3) # only show shadow, not linescene += Line(pts).off().addShadow(z=-30)scene.show(viewup='z')
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。