How do I plot a circle with a given radius and center?
Show older comments
I would like to plot a circle with a given radius and center.
Accepted Answer
More Answers (3)
serwan Bamerni
on 17 Feb 2016
Edited: MathWorks Support Team
on 26 May 2023
9 votes
There is now a function called viscircles():
2 Comments
Walter Roberson
on 17 Oct 2016
This is part of the Image Processing Toolbox
Walter Roberson
on 25 Dec 2020
viscircles(app.segmented, centres, radii, 'color', 'b')
Another possibility is to approximate the circle using a polyshape with a large number of sides and plot that polyshape.
p = nsidedpoly(1000, 'Center', [2 3], 'Radius', 5);
plot(p, 'FaceColor', 'r')
axis equal
2 Comments
Walter Roberson
on 9 Jun 2021
Remember that an equilateral triangle has a 60 degree range.
Using function "fplot" would be my simplest way:
Unit circle:
fplot(@(t) sin(t), @(t) cos(t));
grid on
Circle with center "x", "y" and radius "r":
x = 3; y = 4; r = 5;
fplot(@(t) r*sin(t)+x, @(t) r*cos(t)+y);
grid on;
Categories
Find more on Polar Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


