nsidedpoly
Create a regular polygon.
📝Syntax
pg = nsidedpoly(n)
pg = nsidedpoly(n, 'Center', c)
pg = nsidedpoly(n, 'Radius', r)
pg = nsidedpoly(n, 'SideLength', s)
📥Input Arguments
Parameter Description
n the number of sides (an integer >= 3).
'Center' a two-element center [x y] (default [0 0]).
'Radius' the circumscribed-circle radius.
'SideLength' the length of each side.
📤Output Arguments
Parameter Description
pg a polyshape of the regular polygon.
📄Description

nsidedpoly returns a regular n-sided polygon as a polyshape. Without a radius or side length, the polygon has unit area.

💡Examples
f = figure();
plot(nsidedpoly(6, 'Radius', 2));
axis equal
🔗See Also
polyshape
🕔Version History
Version Description
2.0.0 Initial version.
Edit this page on GitHub