Circle rotating and whirling
2 ビュー (過去 30 日間)
古いコメントを表示

4 件のコメント
採用された回答
infinity
2019 年 7 月 25 日
編集済み: infinity
2019 年 7 月 25 日
Hello,
You can also refer this code,
close all
t = linspace(0,2*pi);
x = cos(t);
y = sin(t);
r1 = 3;
plot(r1*x,r1*y) % plot circle of radius 3
r2 = 2;
r3 = 1;
x2 = r2*cos(-t);
y2 = r2*sin(-t);
axis equal
hold on
for i = 1:length(t)
center = [x2(i),y2(i)];
h = viscircles(center,r3,'color','r');
pause(0.1)
delete(h)
end
hold off
where "r1" is radius of circle 1, and r3 is radius of inner circle.
0 件のコメント
その他の回答 (2 件)
darova
2019 年 7 月 24 日
Look at my idea. Do you like it?
t = linspace(0,2*pi);
x = cos(t);
y = sin(t);
plot(3*x,3*y) % plot circle of radius 10
axis equal
hold on
for t0 = t
h = plot(2*cos(t0),2*sin(t0),'or');
pause(0.03)
delete(h)
end
hold off
2 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!