Calculates the minimum oriented bounding box using the rotating callipers algorithm in 2D. Credits go to Daniel Wollschlaeger. The function modified from <http://dwoll.de/rexrepos/posts/diagBounding.html>.

getMinBBox2D(xy, prec = 1e-08)

Arguments

xy

a matrix of xy values from which to calculate the minimum oriented bounding box.

prec

numerical, rounding precision; default 1e-08, lose to .Machine$double.eps^0.5.

Value

a list with numeric width & height of the bounding box, and the number of points used for the calculation.

Examples

library(ARCOS)
getMinBBox(cbind(c(0,1,3,2,1), c(0,-1,1,3,2)))
#> Error in getMinBBox(cbind(c(0, 1, 3, 2, 1), c(0, -1, 1, 3, 2))): could not find function "getMinBBox"