LownerJohnEllipse | R Documentation |
Minimum area ellipse containing a set of points.
LownerJohnEllipse(pts)
pts |
the points in a two-columns matrix (one point per row); at least three distinct points |
An Ellipse
object.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.