function Cirlce(radius)
x = input('Enter the radius of the circle');
y = 0;
p = 1 - x;
figure;
hold on;
plotPoints(x, y);
while x > y
y = y + 1;
if p <= 0
p = p + 2*y + 1;
else
x = x - 1;
p = p + 2*y - 2*x + 1;
end
plotPoints(x, y);
end
function plotPoints(x, y)
plot(x, y, 'o');
plot(x, -y, 'o');
plot(-x, y, 'o');
plot(-x, -y, 'o');
plot(y, x, 'o');
plot(y, -x, 'o');
plot(-y, x, 'o');
plot(-y, -x, 'o');
drawnow;
end
xlabel('x-co-ordinate')
ylabel('y-co-ordinate')
end
Cite As
Jash (2024). Mmidpoint Theorem (https://www.mathworks.com/matlabcentral/fileexchange/155417-mmidpoint-theorem), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2023b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |