getMinBBox2D: Rotating callipers algorithm in 2D

View source: R/utils.R

getMinBBox2DR Documentation

Rotating callipers algorithm in 2D

Description

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>.

Usage

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)))

dmattek/ARCOS documentation built on Dec. 5, 2024, 11:02 p.m.