How do I plot a circle with a given radius and center?
Mostrar comentarios más antiguos
I would like to plot a circle with a given radius and center.
Respuesta aceptada
Más respuestas (3)
serwan Bamerni
el 17 de Feb. de 2016
Editada: MathWorks Support Team
el 26 de Mayo de 2023
9 votos
There is now a function called viscircles():
2 comentarios
Walter Roberson
el 17 de Oct. de 2016
This is part of the Image Processing Toolbox
Walter Roberson
el 25 de Dic. de 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
1 comentario
Walter Roberson
el 9 de Jun. de 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;
Categorías
Más información sobre Polar Plots en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



