pg = nsidedpoly(n)
pg = nsidedpoly(n, 'Center', c)
pg = nsidedpoly(n, 'Radius', r)
pg = nsidedpoly(n, 'SideLength', s)
| 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. |
| Parameter | Description |
|---|---|
| pg | a polyshape of the regular polygon. |
nsidedpoly returns a regular n-sided polygon as a polyshape. Without a radius or side length, the polygon has unit area.
f = figure();
plot(nsidedpoly(6, 'Radius', 2));
axis equal
| Version | Description |
|---|---|
| 2.0.0 | Initial version. |