question.jfif

댓글 수: 4

infinity
infinity 2019년 7월 24일
Hello,
I have done somthing similar with two cricles, you can refer the code in Animation section in this page
Of course, for your case, you should adapt. I just give you an idea.
Hope it could help.
darova
darova 2019년 7월 24일
Can you please show your attempts? What did you try already?
DARLINGTON ETAJE
DARLINGTON ETAJE 2019년 7월 24일
radius = 5;
center = [10 15];
rotation = pi/3;
translation = [-0.5 -0.6];
rotTForm = [cos(rotation) sin(rotation); -sin(rotation) cos(rotation)];
viscircles(center,radius,'Color','b');
hold on;
%Circle just needs to be translated, as rotation won't have any effect on
%visuals
% viscircles(center+translation,radius,'Color','r');
% centerLines = center + [0 radius; 0 0; radius 0];
% rotatedLines = (centerLines - center)*rotTForm + center + translation;
% plot(centerLines(:,1), centerLines(:,2),'-.');
% hold on
% plot(rotatedLines(:,1), rotatedLines(:,2),'-.');
DARLINGTON ETAJE
DARLINGTON ETAJE 2019년 7월 24일
not exactly though

댓글을 달려면 로그인하십시오.

 채택된 답변

infinity
infinity 2019년 7월 25일
편집: infinity 2019년 7월 25일

0 개 추천

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.

추가 답변 (2개)

darova
darova 2019년 7월 24일

0 개 추천

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

DARLINGTON ETAJE
DARLINGTON ETAJE 2019년 7월 24일
I like your idea...how do I get the inner circle to be bigger...meaning how do I control the radius size of the bigger circle and the inner circle
darova
darova 2019년 7월 24일
What radius of a circle you want?

댓글을 달려면 로그인하십시오.

DARLINGTON ETAJE
DARLINGTON ETAJE 2019년 7월 24일

0 개 추천

the small circle moving around...how can I make it bigger

카테고리

도움말 센터File Exchange에서 Polar Plots에 대해 자세히 알아보기

질문:

2019년 7월 24일

편집:

2019년 7월 25일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by