plottools
polygon
generate 2D or 3D plot object for a polygon
Calling Sequence
Parameters
Description
Notes On Drawing Polygons
Examples
polygon([[x1, y1], [x2, y2], ..., [xn, yn]], options)
polygon([[x1, y1, z1], [x2, y2, z2], ..., [xn, yn, zn]], options)
[x1, y1], [x2, y2], ..., [xn, yn]

list of points in 2D
[x1, y1, z1], [x2, y2, z2], ..., [xn, yn, zn]
list of point in 3D
options
(optional) equations of the form option=value. For a complete list, see plot/options and plot3d/options.
The polygon command creates a two or threedimensional plot data object, which when displayed is a polygon joining points in the specified list. The first argument to polygon must be a list of points. They can be either 2D or 3D.
The plot data object produced by the polygon command can be used in a PLOT or PLOT3D data structure, or displayed using the plots[display] command.
The color=c option is used to fill the polygon with color c. See the plot/interface help page for information about differences in filling for nonstandard interfaces.
Remaining arguments, having the form option = value, are interpreted as options. For more information, see plottools, plot/options and plot3d/options.
In order to be drawn correctly, a polygon must be nonintersecting. In other words, none of its sides may cross another and none of its vertices may be coincident with another. Polygons that do not satisfy this are considered valid structures but may be drawn in unexpected ways.
3D polygons should be planar for correct drawing. A polygon that is not planar may be arbitrarily divided into planar polygons for drawing purposes. Among other effects, this may cause the outline of a polygon not to be coincident in 3D with its polygon.
$\mathrm{with}\left(\mathrm{plottools}\right)\:$
$\mathrm{with}\left(\mathrm{plots}\right)\:$
$\mathrm{display}\left(\mathrm{polygon}\left(\left[\left[0\,0\right]\,\left[3\,4\right]\,\left[3\,1\right]\right]\right)\,\mathrm{color}=\mathrm{red}\,\mathrm{linestyle}=\mathrm{dash}\,\mathrm{thickness}=2\right)$
$\mathrm{display}\left(\mathrm{polygon}\left(\left[\left[0\,0\,0\right]\,\left[1\,1\,1\right]\,\left[1\,1\,0\right]\right]\right)\,\mathrm{axes}=\mathrm{frame}\,\mathrm{color}=\mathrm{green}\,\mathrm{orientation}=\left[45\,60\right]\right)$
See Also
plot/interface
plot/options
plot/structure
plot3d/options
plots[display]
Download Help Document
What kind of issue would you like to report? (Optional)