spkit.geometry
.get_ellipsoid¶
- spkit.geometry.get_ellipsoid(n1=100, n2=100, rx=1, ry=2, rz=1, phi_rang=[0, 6.283185307179586], theta_rang=[0, 3.141592653589793])¶
Get a ellipsoid
- Parameters:
- n1,n2= (int, int)
- rx: radius-x
- ry: radius-y
- rz: radius-z
- phi_rang: phi range
- theta_rang: theta range
- Returns:
- V: (n,3)
3D points
See also
Examples
#sp.geometry.get_ellipsoid import numpy as np import matplotlib.pyplot as plt import spkit as sp V = sp.geometry.get_ellipsoid(n1=50, n2=50, rx=1, ry=2, rz=1,) V += 0.01*np.random.randn(V.shape[0],V.shape[1]) X = sp.create_signal_1d(V.shape[0],bipolar=False,sg_winlen=21,sg_polyorder=2,seed=1) fig, ax = plt.subplots(subplot_kw={"projection": "3d"},figsize=(5,6)) ax.scatter3D(V[:,0], V[:,1], V[:,2], c=X, cmap='jet',s=10) ax.axis('off') ax.view_init(elev=60, azim=45, roll=15) ax.set_xlim([-1,1]) ax.set_ylim([-2,2]) ax.set_zlim([-1,1]) ax.set_title('ellipsoid')