How do I plot a circle with a given radius and center?
Mostra commenti meno recenti
I would like to plot a circle with a given radius and center.
Risposta accettata
Più risposte (3)
serwan Bamerni
il 17 Feb 2016
Modificato: MathWorks Support Team
il 26 Mag 2023
9 voti
There is now a function called viscircles():
2 Commenti
Walter Roberson
il 17 Ott 2016
This is part of the Image Processing Toolbox
Walter Roberson
il 25 Dic 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 Commento
Walter Roberson
il 9 Giu 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;
Categorie
Scopri di più su Polar Plots in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



