当前位置:网站首页>Drawing with MATLAB (1)

Drawing with MATLAB (1)

2022-06-26 08:46:00 NBb-666

figure(1)

% parabola
s = 7;
u =-s:.1:s;
v =-s:.1:s;
[x,y] = meshgrid(u,v);
z = (x.^2 + y.^2)/5;
surf(x,y,z,'FaceAlpha',0.5,'EdgeColor','none','FaceColor',[.9 .9 .9]);

% torus
hold on
for i = 2:6
    
    r = .2;
    R = i;
    [t,p] = meshgrid(linspace(0,2*pi,512));
    x = r*cos(t).*cos(p) + R*cos(p);
    y = r*cos(t).*sin(p) + R*sin(p);
    z = r*sin(t) + R.^2/5;
    surf(x,y,z,'EdgeColor','none','FaceColor','r');
  
end

axis equal off

% camera setttings
campos([60 130 40])
camtarget([0 0 10])
camlight('headlight')
camzoom(1.3)
camproj('perspective')

 Parabolic performance band structure isoenergetic surface

原网站

版权声明
本文为[NBb-666]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202170554361643.html