![]() Theta = np.linspace(0, np.pi, 256).reshape(-1, 256) # the angle from the polar axis, ie the polar angle Phi = np.linspace(0,2*np.pi, 256).reshape(256, 1) # the angle of the projection in the xy-plane It is in general easier to plot such a surface of revolution in a different coordinate system (spherical in this case), rather than attempting to solve an implicit equation (which in most plotting programs ends up jagged, unless you take some countermeasures). Notice that if you use the substitution formulas written below for x, y and z, you'll get an identity. Your ellipsoid is not just an ellipsoid, it's a sphere. Getattr(ax, 'set_lim'.format(axis))((-max_radius, max_radius)) # Radii corresponding to the coefficients:Īx.plot_surface(x, y, z, rstride=4, cstride=4, color='b') from mpl_toolkits.mplot3d import Axes3Dįig = plt.figure(figsize=plt.figaspect(1)) # Square figureĪx = fig.add_subplot(111, projection='3d') Have seen the ones that I have there as defaults, but as I got no previous experience with these libraries, I really don't know what to expect from it. Also I am not sure as to what the linspaces should be set to. ![]() Ran into a website that had a calculator for it, but I had no idea on how to successfully perform this calculation. So I saw a lot of references relating to calculating and plotting of an Ellipse void and in multiple questions a cartesian to spherical or vice versa calculation was mentioned. The ellipsoid that I am drawing to draw is the following: x**2/16 + y**2/16 + z**2/16 = 1. I have ran into a problem relating to the drawing of the Ellipsoid. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |