ellipses4Crown {lidaRtRee}R Documentation

Create elliptical polygons from centres and extensions in four directions

Description

creates polygons from the union of four quarters of ellipses, specified by the ellipse center, and maximum extension in two directions

Usage

ellipses4Crown(x, y, n, s, e, w, id = NULL, step = pi/12, angle.offset = 0)

Arguments

x, y

vectors of numerics. Coordinates of ellipses centers

n, s, e, w

vectors of numerics. Coordinates of ellipses extention in the north, south, east and west directions

id

vector of strings. id of each polygon

step

numeric. Angular step for the modelling of ellipses

angle.offset

numeric. Angle offset to tilt ellipses, positive values rotates clockwise

Value

a list of data.frame containing the coordinates of polygons

See Also

pointList2poly

Examples

# compute coordinates of ellipses
ellipses1 <- ellipses4Crown(c(0, 10), c(0, 10), c(2, 2), c(3, 4), c(2.5, 3), c(2, 3),
  id = c("A", "B")
)
ellipses1[["A"]]
# tilted ellipse
ellipses2 <- ellipses4Crown(c(0, 10), c(0, 10), c(2, 2), c(3, 4), c(2.5, 3), c(2, 3),
  angle.offset = pi / 6
)
ellipses2[[2]]

# draw ellipses in black, tilted ellipses in red
plot(ellipses1[[1]], type = "l", asp = 1, xlim = c(-5, 15), ylim = c(-5, 15))
lines(ellipses1[[2]])
lines(ellipses2[[1]], col = "red")
lines(ellipses2[[2]], col = "red")

[Package lidaRtRee version 4.0.5 Index]