timothy1985 发表于 2015-11-22 18:18:11

surf画出的图怎么绕坐标轴旋转?


如题,根据surf画出的图像,按照需要平移、旋转。

平移好处理,旋转的时候,有没有一种类似于输入相对坐标的命令或者函数之类的简单方法。

如果按照坐标旋转的方法,需要对三个坐标需要共同处理,太麻烦。

大神们,有没有好方法?

例如,help中的这个例子,如何将其绕X轴旋转45度,再绕Z轴旋转30度。

<P>t = 0:pi/10:2*pi;
= cylinder(2+cos(t));
surf(X,Y,Z)
axis square </P>
拜谢各位!

timothy1985 发表于 2015-11-22 22:15:53

帮助手册里面的介绍:

Rotate a graphics object 180º about the x-axis. h = surf(peaks(20));
rotate(h,,180)
Rotate a surface graphics object 45º about its center in the z direction. h = surf(peaks(20));
zdir = ;
center = ;
rotate(h,zdir,45,center)

可是运行完了就这样:
h = surf(peaks(20));
rotate(h,,180)
??? Attempt to execute SCRIPT rotate as a function.

另外,下面的这个帖子讲解绕空间任意轴旋转的方法
http://page.renren.com/600754883/note/772593223
页: [1]
查看完整版本: surf画出的图怎么绕坐标轴旋转?