Mmidpoint Theorem

Version 1.0.0 (1.33 KB) by Jash
Mmidpoint Theorem
1 Download
Updated 22 Nov 2023

View License

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 Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0