Tube Function
Versión 2.0.0.0 (2,21 KB) por
Lateef Adewale Kareem
This function is the numerical analogy to the tube function in maple
close all
[X,Y,Z] = tubeN(@(t) t/3, 30, @(t)[ t.*sin(t), t.*cos(t), 20-t],[0,20],120);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
[X,Y,Z] = tubeN(@(t) sin(t),20,@(t)[ t, 0*t,0*t],[0,10],40);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
[X,Y,Z] = tubeN(@(t)sqrt(1-t.^2),20,@(t)[sin(pi*t),t,t+1],[-1,1],50);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
[X,Y,Z] = tubeN(@(t)sqrt(1-t.^2),20,@(t)[sin(pi*t),cos(pi*t),t+1],[-1,1],50);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
[X,Y,Z] = tubeN(@(t)0.1+0*t,20,@(t)[(4 + sin(20*t)).*cos(t),(4 + sin(20*t)).*sin(t),cos(20*t)],[0,2*pi],1000);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
[X,Y,Z] = tubeN(@(t)0.1+0*t,20,@(t)[(2 + cos(1.5*t)).*cos(t),(2 + cos(1.5*t)).*sin(t),sin(1.5*t)],[0,4*pi],500);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
[X,Y,Z] = tubeN(@(t)1+0*t,20,@(t)[3.*cos(t),3.*sin(t),0*t],[0,2*pi],100);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
xfun = @(t)sign(sin(t)).*(abs(sin(t))).^0.75;
yfun = @(t)sign(cos(t)).*(abs(cos(t))).^0.75;
zfun = @(t)abs(sin(t)).^2;
[X,Y,Z] = tubeN(@(t)0.1+0*t,20,@(t)[xfun(t), yfun(t), zfun(t)],[0,2*pi],500);
figure; s = surf(X,Y,Z); s.FaceColor = 'r'; s.EdgeAlpha = 0.3; axis equal
camlight; lighting gouraud
Citar como
Lateef Adewale Kareem (2024). Tube Function (https://www.mathworks.com/matlabcentral/fileexchange/53907-tube-function), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Se creó con
R2012b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
- MATLAB > Graphics > Formatting and Annotation > 3-D Scene Control > Lighting, Transparency, and Shading >
Más información sobre Lighting, Transparency, and Shading en Help Center y MATLAB Answers.
Etiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.