View source: R/benjamini_leaves.R
benjamini_leaf | R Documentation |
Generate bezier curve coordinates of a benjamini leaf
benjamini_leaf(
leaf_params = gen_leaf_parameters(),
omega = 0,
xrot = leaf_params$x0,
yrot = leaf_params$y0,
precision = 2
)
leaf_params |
parameter that control the leaf shape |
omega |
rotation angle of the leaf |
xrot |
x coordinate of pivot point (preset to leaf origin). |
yrot |
x coordinate of pivot point (preset to leaf origin). |
precision |
numeric precision of the output |
A dataframe conaining the data for the bezier curves of a leaf (see example).
df <- benjamini_leaf()
df
df %>%
# This generated a unique identifier for the 4 rows of each bezier curve:
tidyr::unite(b, element, i_part, remove = FALSE) %>%
ggplot2::ggplot() +
ggforce::geom_bezier(ggplot2::aes(x = x, y = y, group = b))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.