LownerJohnEllipse {PlaneGeometry} | R Documentation |
Löwner-John ellipse (ellipse hull)
Description
Minimum area ellipse containing a set of points.
Usage
LownerJohnEllipse(pts)
Arguments
pts |
the points in a two-columns matrix (one point per row); at least three distinct points |
Value
An Ellipse
object.
Examples
pts <- cbind(rnorm(30, sd=2), rnorm(30))
ell <- LownerJohnEllipse(pts)
box <- ell$boundingbox()
plot(NULL, asp = 1, xlim = box$x, ylim = box$y, xlab = NA, ylab = NA)
draw(ell, col = "seaShell")
points(pts, pch = 19)
all(apply(pts, 1, ell$contains)) # should be TRUE
[Package PlaneGeometry version 1.6.0 Index]