View source: R/shape_generator.R
ellipse | R Documentation |
This function is derived from 'VennDiagram::ell2poly', we modified it and then it can generating a closed ellipse, which is a requirement for further transformation to a POLYGON sf object.
ellipse(x = 0, y = 0, a = 2, b = 1, rotation = 0, n = 100)
x, y |
the coordinates of ellipse center |
a |
radius of short arm |
b |
radius of long arm |
rotation |
rotation in degree |
n |
number of points |
a matrix representing ellipse coordinates
# plot the default ellipse
library(sf)
library(ggVennDiagram)
ellipse() %>% st_linestring() %>% plot()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.