700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > matlab绘制 椭球体 如何用绘图法绘制椭球体

matlab绘制 椭球体 如何用绘图法绘制椭球体

时间:2021-02-16 10:34:06

相关推荐

matlab绘制 椭球体 如何用绘图法绘制椭球体

好吧,比我想象的要容易。有一个alphahull选项,它要求自动计算相应的三角剖分。在from plotly.offline import iplot, init_notebook_mode

from plotly.graph_objs import Mesh3d

from numpy import sin, cos, pi

# some math: generate points on the surface of ellipsoid

phi = np.linspace(0, 2*pi)

theta = np.linspace(-pi/2, pi/2)

phi, theta=np.meshgrid(phi, theta)

x = cos(theta) * sin(phi) * 3

y = cos(theta) * cos(phi) * 2

z = sin(theta)

# to use with Jupyter notebook

init_notebook_mode()

iplot([Mesh3d({

'x': x.flatten(),

'y': y.flatten(),

'z': z.flatten(),

'alphahull': 0

})])

这是R版:

^{pr2}$

编辑:也可以使用type='surface'生成参数图:在这种情况下,必须提供二维x和{}。在library(plotly)

library(pracma)

mgrd

U

V

frame

plot_ly(frame, type='surface', x=x, y=y, z=z, showlegend=F, showscale=F,

colorscale=list(list(0, 'blue'), list(1, 'blue')))

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。