Description Usage Arguments Value Note Author(s) Examples
View source: R/rounded-rectangle.R
This function computes the vertices of a rectangle with rounded corners.
1 2 3 4 5 6 7 8 | rounded_rectangle(
center = c(0, 0),
width = 1,
height = 1,
rotation = 0,
corner.radius = NULL,
vertices.per.corner = 50
)
|
center |
The center/centroid of the shape. Can either be a 1 x 2 data frame/matrix or a numeric vector length 2. |
width, height |
The width and height of the rectangle before the corners are rounded. |
rotation |
The amount of rotation applied to the shape, in radians. |
corner.radius |
The radius of the circular arcs. Should be less than min(width, height) / 2. |
vertices.per.corner |
The number of vertices that each circular arc consists of. |
A data frame containing the columns x
and y
, where each
row is a vertex in the rounded rectangle.
The result may contain less than 4*vertices.per.corner
vertices.
In certain situations, consecutive vertices will end up having the same coordinates.
The duplicates are then removed.
Mathias Isaksen mathiasleanderi@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.