MATLAB Answers

How to plot a circle of some radius on a polar plot ?

159 views (last 30 days)
L K on 18 Mar 2017
Edited: Ron Beck on 2 Mar 2018
eg. i want a small circle with origin as center of some radius...ON the POLAR plot

Accepted Answer

Walter Roberson
Walter Roberson on 18 Mar 2017
th = linspace(0,2*pi,50);
r = 10;
Ron Beck
Ron Beck on 2 Mar 2018
I have used this script and it works (changed polar to polarPlot) but can't run it as a function. Any ideas?

Sign in to comment.

More Answers (1)

Gabriel Malagon Carvajal
Gabriel Malagon Carvajal on 9 Sep 2017
When is not center in the origen?
  1 Comment
Walter Roberson
Walter Roberson on 9 Sep 2017
%need centres for demo purposes
xc = randn() * 5; yc = randn() * 5;
%the work
th = linspace(0,2*pi,50);
r = 10;
[x,y] = pol2cart(th,r);
[th1, r1] = cart2pol( x+xc, y+yc );
polar(th1, r1);

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!