学习型 ASP/PHP/ASP.NET 主机 30元/年全能 ASP/PHP/ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
发新话题
打印

如何在Matlab中绘制z方向上有重叠的三维曲面

如何在Matlab中绘制z方向上有重叠的三维曲面

比如球体,对于任意一组(x,y),最外边一圈除外,都有两个z与之对应。

这一类的曲面如何绘制?

请说明更加一般的情况。

TOP

可以先在球坐标内生成数据,再转换为直角坐标,再mesh

TOP

回复:(hitzhang)可以先在球坐标内生成数据,再转换...

但如果在球坐标下也发生曲叠呢?

TOP

mesh函数的画图过程我不是很熟
不过你可以通过画简单的图形了解一下它的画图过程
我知道这个函数可以画出任意形状的三维图形

TOP

DING
!!!!!!!!!!!!!!!!!!!

TOP

请教高手一个问题:
在一个立方体中如何任意进行斜面分割???
[x,y,z] = meshgrid(-2:.2:2,-2:.25:2,-2:.16:2);
v = x.*exp(-x.^2-y.^2-z.^2);
xslice = [-2,2]; yslice = [-2,2]; zslice = [-2,2];
slice(x,y,z,v,xslice,yslice,zslice)%直角切割
colormap hsv
现在想对它进行任意的斜面切割
(用鼠标点击立体图中的几个点,或者手动输入几个点),根据这几个点位置不同来确定不同的平面),如果高手有好的方法,小弟更是感激不尽!!!!!!
qq:491242712

TOP

对于不同的z,可以用hold on命令分开画嘛

TOP

回复 5# 的帖子

Slicing At Arbitrary Angles


You can also create slices that are oriented in arbitrary planes. To do this, Create a slice surface in the domain of the volume (surf, linspace). Orient this surface with respect to the axes (rotate). Get the XData, YData, and ZData of the surface (get). Use this data to draw the slice plane within the volume.

TOP

回复 6# 的帖子

For example, these statements slice the volume in the first example with a rotated plane. Placing these commands within a for loop "passes" the plane through the volume along the z-axis.
for i = -2:.5:2
    hsp = surf(linspace(-2,2,20),linspace(-2,2,20),zeros(20)+i);
    rotate(hsp,[1,-1,1],30)
    xd = get(hsp,'XData');
    yd = get(hsp,'YData');
    zd = get(hsp,'ZData');
    delete(hsp)
    slice(x,y,z,v,[-2,2],2,-2) % Draw some volume boundaries
    hold on
    slice(x,y,z,v,xd,yd,zd)
    hold off
    axis tight
    view(-5,10)
    drawnow
end

TOP

发新话题