📄 torus.m
字号:
function out = torus(nbr,rad1,rad2);
% The function
%
% out = torus(nbr,revo,step);
%
% generates a 3-dimensional database with <nbr> elements.
% These elements draw a hollow torus.
% The optional parameter <rad1> gives the main radius of
% the torus; default value is 0.75.
% The optional parameter <rad2> sets the second radius;
% default value is 0.25.
if nargin<3, rad2 = 0.25; end;
if nargin<2, rad1 = 0.75; end;
r = 2*pi*rand(nbr,1);
s = 2*pi*rand(nbr,1);
out = [(rad1+rad2*cos(s)).*cos(r), (rad1+rad2*cos(s)).*sin(r), rad2*sin(s)];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -