I have a 4d or higher ellipsoid in matrix form (which form is important). I wish to plot 3d dimensional plots (The projection on 3d hyperplane). Of the 4/5/6 dimensions I am projecting from, I want to be able to choose any three of the axes.
Now there two ways I think it can happen:
- I describe the matrix in 4 or higher dimension as a collection of points and then I can project the points on a 3d hyperplane (the projecting is easy).
For example plotting in 3d in matplotlib is by using numpy.linspace to create a coordinates (arrays of points). One solution is Plotting Ellipsoid with Matplotlib. But the prob I am facing is how the cartesian coordinates corresponding to sperical angles are created and how to extend this to 4 or higher dimensions. This is a very important prob. Can someone explain what exactly happens in these lines? I could extend this to higher dimensions.
# 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))
- Or I "reduce" the matrix A, which stores information in 4 or higher dimension to 3d and then plot. I am searching for a way to reduce.
Thanks in advance.