Rotate function
% The function Rotatefxn3D is a numerical analogy of the Maple rotating
% function Rotate. It generates the X,Yand z coodinates to be used by the
% surf function to generate the required surface, just like the matlab
% function cylinder does.
% fxn is the function to be rotated
% axis is the axis of rotation eg 'x','y','z'
% xbound is the range of values of x
% arcbound is the bound of angle of rotation
% Nx is the number of step in x direction
% Na is the number of angular steps
Eample1:
[X,Y,Z] = Rotatefxn3D(@(t) sin(t),'x',[0,10],40,[0,2*pi],20);
s = surf(X,Y,Z); set(s,'FaceColor','r'); axis equal
camlight
lighting gouraud
title('Rotatefxn3D(@(t) sin(t),''x'',[0,10],40,[0,2*pi],20)')
Example2:
[X,Y,Z] = Rotatefxn3D(@(t) sin(t),'z',[0,10],20,[0,2*pi],40);
s = surf(X,Y,Z); set(s,'FaceColor','r'); axis equal
camlight
lighting gouraud
title('Rotatefxn3D(@(t) sin(t),''z'',[0,10],20,[0,2*pi],40)')
引用格式
Lateef Adewale Kareem (2024). Rotate function (https://www.mathworks.com/matlabcentral/fileexchange/53908-rotate-function), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
- MATLAB > Graphics > Formatting and Annotation > 3-D Scene Control > Lighting, Transparency, and Shading >
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0.0 |