
Лаб. 9 КП АлГем (Поверхности второго порядка)
.docx
from sympy.plotting import plot3d_parametric_surface from sympy.abc import theta, x, phi import numpy as np import sympy as sp import matplotlib.pyplot as plt from mpl_toolkits import mplot3d from sympy import * y = sp.sqrt((x**2/9-1)*4) plot3d_parametric_surface( (y+3,x*sin(phi),x*cos(phi),(x, -15, 15), (phi, 0, np.pi)), (-y-3,x*sin(phi),x*cos(phi),(x, -15, 15), (phi, 0, np.pi)), xlim = (16, -16), size = (10, 10))
<sympy.plotting.plot.Plot at 0x5ecb760>
a=2 b=1 plot3d_parametric_surface( (a+b*sp.cos(phi))*sp.cos(theta), (a+b*sp.cos(phi))*sp.sin(theta), b*sin(phi), (phi, 0, 2*np.pi), (theta, 0, 2*np.pi), xlim = (-2.4, 2.4), ylim = (-2.4, 2.4), size = (6, 6))
<sympy.plotting.plot.Plot at 0x69b8248>
y = sp.sqrt((x**2/2+1)*3) plot3d_parametric_surface( (2*sp.cos(phi),3*sp.sin(phi),y,(x, -5, 5), (phi, 0, np.pi)), (2*sp.cos(phi),-3*sp.sin(phi),y,(x, -5, 5), (phi, 0, np.pi)), size = (10, 10))
<sympy.plotting.plot.Plot at 0xa60b400>