aabb

PURPOSE ^

AABB Computes the Axis-Aligned Bounding Box (AABB) of a set of points in N

SYNOPSIS ^

function box = aabb(pts)

DESCRIPTION ^

AABB Computes the Axis-Aligned Bounding Box (AABB) of a set of points in N
dimensions
 
 Input:
   - pts: points matrix, of size numPts x dim.
 
 Output:
   - box: AABB of the input points, of the form [xMin, yMin, ... dimMin, sizeX, sizeY, ... sizeDim]

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function box = aabb(pts)
0002 %AABB Computes the Axis-Aligned Bounding Box (AABB) of a set of points in N
0003 %dimensions
0004 %
0005 % Input:
0006 %   - pts: points matrix, of size numPts x dim.
0007 %
0008 % Output:
0009 %   - box: AABB of the input points, of the form [xMin, yMin, ... dimMin, sizeX, sizeY, ... sizeDim]
0010 %
0011 
0012 [~, numDims] = size(pts);
0013 box = zeros(1, 2*numDims);
0014 for i = 1:numDims
0015     minVal = min(pts(:, i));
0016     maxVal = max(pts(:, i));       
0017     box(i) = minVal;
0018     box(i+1+dim) = maxVal-minVal;    
0019 end
0020

Generated on Thu 10-Dec-2020 17:34:27 by m2html © 2005