Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ellipse

generating a closed ellipse


Description

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.

Usage

ellipse(x = 0, y = 0, a = 2, b = 1, rotation = 0, n = 100)

Arguments

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

Value

a matrix representing ellipse coordinates

Examples

# plot the default ellipse
library(sf)
library(ggVennDiagram)
ellipse() %>% st_linestring() %>% plot()

ggVennDiagram

A 'ggplot2' Implement of Venn Diagram

v1.1.0
GPL-3
Authors
Chun-Hui Gao [aut, cre] (<https://orcid.org/0000-0002-1445-7939>), Guangchuang Yu [ctb] (<https://orcid.org/0000-0002-6485-8781>), Adrian Dusa [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.