Python 使用matplotlib绘制椭球体所需的说明

Python 使用matplotlib绘制椭球体所需的说明,python,numpy,matplotlib,Python,Numpy,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.

这个问题直接涉及到

我需要建立一个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))
我需要答案:cosu和sinv等是如何选择的


提前谢谢。

我认为这更像是一个数学问题,而不是Python问题。@Simpom我想使用过这么多的用户一定有,因为这是matplotlib网站上3d绘图学习模块的一部分,所以我可以回答我的问题,这样我就可以扩展到更高的维度。这个问题似乎与主题无关,因为它属于如何将其转移到那里?我应该在那里再问一次,还是有办法把它联系起来?