from a circle to polygon
Show older comments
Hello All,
If I have a circle (x-a)^2 +(x-b)^2 = r^2 , is the any matlab function that converts this circle to polygon?
Thanks
Mohamed
Accepted Answer
More Answers (1)
As @Scott MacKenzie stated, you can approximate a circle as a many-sided regular polygon. The nsidedpoly function will create such a many-sided polygon that you can plot or operate on.
for k = 1:6
subplot(2, 3, k)
P = nsidedpoly(3^k);
plot(P);
title(3^k + " sides")
end
Categories
Find more on Computational Geometry 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!
