# coordinates given by a suitable data frame
bb <- getMinBBox(DFsavage) # minimum bounding box
# plot points and minimum bounding box
plot(point.y ~ point.x, data=DFsavage, asp=1,
xlim=range(bb$pts[ , 1]), ylim=range(bb$pts[ , 2]), pch=16)
drawBox2(bb, fg='blue', colCtr='blue', pch=4, cex=2)
bb$FoM # figure of merit
bb$angle # box orientation
# coordinates given by a matrix
## Not run:
# xy <- matrix(round(rnorm(16, 100, 15)), ncol=2)
# getMinBBox(xy)
# ## End(Not run)
Run the code above in your browser using DataLab