📄 trefoilknot.m
字号:
function out = trefoilknot(nbr);
% The function
%
% out = trefoilknot(nbr);
%
% generates a 3-dimensional database with <nbr> elements.
% These elements draw a trefoil knot.
t = 2*pi*rand(nbr,1);
x = 41*cos(t) - 18*sin(t) - 83*cos(2*t) - 83*sin(2*t) - 11*cos(3*t) + 27*sin(3*t);
y = 36*cos(t) + 27*sin(t) - 113*cos(2*t) + 30*sin(2*t) + 11*cos(3*t) - 27*sin(3*t);
z = 45*sin(t) - 30*cos(2*t) + 113*sin(2*t) - 11*cos(3*t) + 27*sin(3*t);
out = [x,y,z];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -