polygon_points | R Documentation |
Create a series of points in a polygon with a given resolution
polygon_points(x, y, res = 20)
x |
vector of |
y |
vector of |
res |
resolution to set between vertices, i.e. number of points in each line segment |
x
and y
are vectors whose pairs give the vertices of the polygon object
This is a simple function that takes the same initial two arguments as polygon
, but creates
points that go over the course of the polygon edges. To create a full shape, the final vertex of the pairs x
and y
must match the first vertex.
a matrix whose first column are the points in x
and whose second column are the points in y
# make unit square polygon_points(c(-1,-1,1,1,-1), c(-1,1,1,-1,-1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.