Need a script to plot a circle with given radius and center
Show older comments
I need some help guys! Need a script to plot a circle with center(5,7) and radius 3. I have these:
clear clc
r=3;
t=0:pi/24:2*pi;
x=r*cos(t);
y=r*sin(t);
plot(x,y,x,y)
grid on
But only the radius works.. help please.
Accepted Answer
More Answers (2)
Image Analyst
on 11 Jun 2020
Here's another way
viscircles([5,7], 3);
2 Comments
Tamara del Águila
on 26 May 2021
but which units does viscircle use? When I draw a circular roi with drawcircle, and then I plot in the obtained coordinates a circle with viscircle, the size do not match...
Image Analyst
on 26 May 2021
I believe they both use units of whatever the axes control is using. I think they should be the same. Post a small snippet of your code showing how you compute "size" and a screenshot showing the different circle sizes.
Alamgir Khan
on 11 Jun 2020
Edited: Alamgir Khan
on 11 Jun 2020
0 votes
In parametric form of the circle of radius 1, at centred(0,0) x=cos(2 pi×t) and y=sin(2pi ×t) using ezplot command
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!