LownerJohnEllipse: Löwner-John ellipse (ellipse hull)

View source: R/Ellipse.R

LownerJohnEllipseR 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

PlaneGeometry documentation built on Aug. 10, 2023, 1:09 a.m.