How to plot a circle of some radius on a polar plot, when the circle is not centered in the origen?

조회 수: 19 (최근 30일)
eg. i want a small circle with other point as center of some radius...ON the POLAR plot
  댓글 수: 1
Adam Danz
Adam Danz 2021년 6월 15일
The easiest approach would be to use the rectangle function with the curvature option to make circles and to fill all of them.
Plot them in order from bottom to top with the top most circle being white.

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

답변 (2개)

Gabriel Malagon Carvajal
Gabriel Malagon Carvajal 2017년 9월 9일
xCenter = 12; yCenter = 10; theta = 0 : 0.01 : 2*pi; radius = 5; x = radius * cos(theta) + xCenter; y = radius * sin(theta) + yCenter; %[theta,rho] = cart2pol(x,y) [abtheta,abrho] = cart2pol(x,y); polar(abtheta,abrho,'o'); %centerDeltacurrent

Jose Marques
Jose Marques 2017년 9월 9일
Hello Gabriel Malagon Carvajal. You can try this:
%k is a constant that you can difine as the circles size
k = 0.4 %a exemplo of a 0.4 diamater circle
theta = linspace(0,2*pi);
rho = k*sin(theta);
polarplot(theta,rho)
  댓글 수: 4
Jose Marques
Jose Marques 2017년 9월 9일
You can change the values of radius, x_center and y_center:
radius = 1;
x_center = 0.5;
y_center = 0.5;
th = 0:pi/50:2*pi;
xunit = radius * cos(th) + x;
yunit = radius * sin(th) + y;
[theta,rho] = cart2pol(xunit,yunit)
polarplot(theta,rho)

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

카테고리

Help CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by