用matplotlib绘制椭球体的必要说明

2024-06-28 19:01:18 发布

您现在位置:Python中文网/ 问答频道 /正文

这个问题直接指向Plotting Ellipsoid with Matplotlib。在

我需要一个4维或更高维的椭球体模型。在

我需要理解上面问题的答案,这样我就可以扩展它来解决我的问题了。这些代码行是如何工作的:

# Cartesian coordinates that correspond to the spherical angles:
# (this is the equation of an ellipsoid):
x = rx * np.outer(np.cos(u), np.sin(v))
y = ry * np.outer(np.sin(u), np.sin(v))
z = rz * np.outer(np.ones_like(u), np.cos(v))

我需要答案:cos(u)和sin(v)等是如何选择的?在

提前谢谢。在


Tags: the答案代码模型matplotlibwithnpsin