ellipse: Create an Ellipse

ellipseR Documentation

Create an Ellipse

Description

Generate an ellipse from center coordinates, major and minor axis radii, and angle rotation.

Usage

ellipse(x = 0, y = 0, sx = 2, sy = 1, rotation = 0, n = 100)

st_ellipse(geometry, sx, sy, rotation = 0, n = 100)

Arguments

x

longitude of center point

y

latitude of center point

sx

radius of major axis

sy

radius of minor axis

rotation

the degree of rotation of the ellipse

n

the number of coordinates to generate for the ellipse

geometry

an sf ST_POINT geometry. Can be sfg, sfc, or sf object

Details

ellipse() returns a matrix of point locations defining the ellipse. st_ellipse() returns an sf object with LINE geography of the ellipse. Increasing n increases the number of points generated to define the ellipse shape.

ellipse() function is adapted from ggVennDiagram.

Value

an sf object

Examples

ellipse(n = 10)
st_ellipse(sf::st_point(c(0, 0)), sx = 10, sy = 10)

sfdep documentation built on Sept. 13, 2024, 5:07 p.m.