Home > matGeom > geom2d > rectToBox.m

rectToBox

PURPOSE ^

RECTTOBOX Convert rectangle data to box data.

SYNOPSIS ^

function box = rectToBox(rect)

DESCRIPTION ^

RECTTOBOX Convert rectangle data to box data.

   BOX = rectToBox(RECT)
   Converts from rectangle representation to box representation.
   RECT is given by [X0 Y0 WIDTH HEIGHT], with WIDTH and HEIGHT > 0
   BOX is given by [XMIN XMAX YMIN YMAX].

   Example
   rectToBox

   See also
   boxToRect, drawBox, drawRect

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function box = rectToBox(rect)
0002 %RECTTOBOX Convert rectangle data to box data.
0003 %
0004 %   BOX = rectToBox(RECT)
0005 %   Converts from rectangle representation to box representation.
0006 %   RECT is given by [X0 Y0 WIDTH HEIGHT], with WIDTH and HEIGHT > 0
0007 %   BOX is given by [XMIN XMAX YMIN YMAX].
0008 %
0009 %   Example
0010 %   rectToBox
0011 %
0012 %   See also
0013 %   boxToRect, drawBox, drawRect
0014 
0015 % ------
0016 % Author: David Legland
0017 % E-mail: david.legland@inrae.fr
0018 % Created: 2012-08-23, using Matlab 7.9.0.529 (R2009b)
0019 % Copyright 2012-2024 INRA - Cepia Software Platform
0020 
0021 box = [rect(:,1) rect(:,1)+rect(:,3) rect(:,2) rect(:,2)+rect(:,4)];

Generated on Thu 21-Nov-2024 11:30:22 by m2html © 2003-2022