用MATLAB完成,在给出的程序中有三个圆,要求红心实圆沿小圆顺时针旋转,同时小圆沿大圆相切顺时针运动,画出红心实圆的运动轨迹
function [] = circle( x,y,r )
%画出大圆
theta=-7:0.1:7;
Circle1=pi*cos(theta);
Circle2=pi*sin(theta);
plot(Circle1,Circle2,'b');
hold on
%画出小圆
theta=-7:0.1:7;
Circle1=1*cos(theta);
Circle2=pi+1+1*sin(theta);
plot(Circle1,Circle2,'m');
%画出小圆上动点
plot(0,2+pi,'ro','Markersize',10,'MarkerFaceColor','r')
axis equal
end
|