minAreaRect: Fit a Rectangle Around a Set of 2D Points

View source: R/shape.R

minAreaRectR Documentation

Fit a Rectangle Around a Set of 2D Points

Description

minAreaRect calculates the minimum area enclosing rectangle that fits a set of 2D points.

Usage

minAreaRect(x, y)

Arguments

x

A vector of x coordinates.

y

A vector of y coordinates of the same lenght as x.

Value

A list containing the height and width (in pixels) of the ellipse, the angle (in degrees) of its main axis with respect to the x axis, and the x and y coordinates of its center.

Author(s)

Simon Garnier, garnier@njit.edu

See Also

fitEllipse, boxPoints

Examples

minAreaRect(rnorm(100), rnorm(100))


swarm-lab/Rvision documentation built on Feb. 7, 2024, 4:59 a.m.