?? 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 + -