How to plot circle by one single equation?
Show older comments
I need code which plot the circle in one single equation (variable). I have the code but i need code of single equation, the code which i have, it is composed of two equations as follow :
r=2;
x=0;
y=0;
th = 0:pi/6:2*pi;
xunit = r * cos(th) + x;
yunit = r * sin(th) + y;
plot(xunit, yunit);
Accepted Answer
More Answers (3)
Aditya Gupta
on 26 Jun 2020
Adding to the MVP's (perfect) answer, I found one more way:
radius = 2;
originX = 0;
originY = 0;
rectangle('Position',[originX-radius originY-radius 2*radius 2*radius], ...
'Curvature',[1 1]);
axis equal
Harshith pothuri
on 14 Jan 2021
0 votes
r=2;
x0=0;
y0=0;
theta = linspace(0,2*pi,100);
plot(x0 + r*cos(theta),y0 + r*sin(theta),'-')
axis equal
krishan Gopal
on 9 Dec 2021
0 votes
Hi, can you tell me how to draw line pattern inside the circle
Categories
Find more on Language Fundamentals 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!


