英语翻译function [xcar,ycar]=drawcardioid(varargin) % A demonstration to show the form of the cardioid error(nargchk(0,3,nargin)); nin = nargin; if nin==0 cx1=0; cy1=0; % The coordinate of the center point.r=1; % The radius of the circle.elseif n

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/12 07:16:02
英语翻译function [xcar,ycar]=drawcardioid(varargin) % A demonstration to show the form of the cardioid error(nargchk(0,3,nargin)); nin = nargin; if nin==0 cx1=0; cy1=0; % The coordinate of the center point.r=1; % The radius of the circle.elseif n

英语翻译function [xcar,ycar]=drawcardioid(varargin) % A demonstration to show the form of the cardioid error(nargchk(0,3,nargin)); nin = nargin; if nin==0 cx1=0; cy1=0; % The coordinate of the center point.r=1; % The radius of the circle.elseif n
英语翻译
function [xcar,ycar]=drawcardioid(varargin)
% A demonstration to show the form of the cardioid
error(nargchk(0,3,nargin));
nin = nargin;
if nin==0
cx1=0; cy1=0; % The coordinate of the center point.
r=1; % The radius of the circle.
elseif nin==1
cx1=0; cy1=0;
r=varargin{1};
elseif nin==2
cx1=0;
cy1= vararin{1};
r = varargin{2};
else
cx1=vararin{1};
cy1=vararin{2};
r=vararin{3};
end
if nargout==0
flag=1;
else
flag=0;
end
theta = linspace(0,2*pi,120);
x0 = r*cos(theta);
y0 = r*sin(theta);
x1 = x0+cx1;
y1 = y0+cy1;
cx2 = 2*x0+cx1;
cy2 = 2*y0+cy1;
x3=x0.*cos(theta)-y0.*sin(theta);
y3=x0.*sin(theta)+y0.*cos(theta);
for k=1:120
x2(k,:) = cx2(k)+x0;
y2(k,:) = cy2(k)+y0;
xx(k)=cx2(k)+x3(k);
yy(k)=cy2(k)+y3(k);
end
xcar = xx;
ycar = yy;
if flag
plot(x1,y1);
axis([cx1-3.2*r cx1+3.2*r cy1-3.2*r cy1+3.2*r]);
axis manual
hold on
daspect([1 1 1]);
set(gcf,'doublebuffer','on');
for k = 1:120
plot(x2(k,:),y2(k,:),'g',xx(k),yy(k),'r*');
pause(0.05);
%plot(x2,y2,'color','w');
end
end

英语翻译function [xcar,ycar]=drawcardioid(varargin) % A demonstration to show the form of the cardioid error(nargchk(0,3,nargin)); nin = nargin; if nin==0 cx1=0; cy1=0; % The coordinate of the center point.r=1; % The radius of the circle.elseif n
上述matlab程序代码执行效果如下图所示:

原理是:一个动圆沿一个定圆的圆周外部无滑动的滚动(两个圆的半径相等),动圆的圆周上的一固定点运动的轨迹就是心形线.

本人对matlab不是很熟悉,直接调用心形线参数方程写的.

源码:

英语翻译function [xcar,ycar]=drawcardioid(varargin) % A demonstration to show the form of the cardioid error(nargchk(0,3,nargin)); nin = nargin; if nin==0 cx1=0; cy1=0; % The coordinate of the center point.r=1; % The radius of the circle.elseif n function 英语翻译question:write each function as a combination of elementary functions y=八次根号下(2+|x|) 英语翻译Symbolically,the range of a function is the set of all elements y in B such that exists x with f(x)=y 英语翻译in order to have a inverse function,the function must be one-to-one,but why the sine function has a inverse function? 英语翻译In this section,we introduce some properties of the Green’s function G(x,y) of (-△)on the unit ball B with Dirichlet boundary conditions. 英语翻译If the linear function y=ax+b passes through the point (-2,0),but not the first Quadrant,then the solution set for ax>b is ( ). 英语翻译my exclusive function is to your unspeakable happiness 英语翻译1.chief2.turned down3.in favour of 4.function 英语翻译“put this equation in the form of logistic function 英语翻译3.fzero-zero of a function of one variable 英语翻译manufaturing entity (by nature/ function)services entity (by nature/ function)这后面by nature/ function要怎样解释比较好呢? 英语翻译If your application uses the DrawDibBegin function with the DrawDibDraw function,set this value with DrawDibBegin rather than DrawDibDraw. 英语翻译1.Control units designed to be used in industrial plants where the data processing function is a secondary function. 英语翻译编程的int nIndex; // index of next function to callindex=索引next=下一个function=函数call=调用------------------------of 在这里是next function to call的索引,还是next function”的索引 to call 英语翻译Find a linear equation that models the temperature T as a function of the number of chirps per minute N.请问T和N 谁是Y 谁是X Input argument x is undefined.function y=f(x) y=exp(-x)+exp(x); 英语翻译Sketch the function,and then approximate the real zeros to the nearest tenth.