function output=rect(a,b,w)
% rect
%   output = rect(a,b,w) plots a rectangule and returns the handles of the
%   lines.
%   (a,b) is the mid-point coordinate of the left side of the block and w
%   is the width

%   Project: IMPACT
%   Title of Code: rect
%   Relevant additional documentation:
%   Developer: Carlos Gonzalez
%   External Dependencies: NA
%
%   Disclaimer
%   CAUTION: It is strongly recommended that changes to this code
%   should be avoided without first consulting with authors.


if nargin < 3, w = 7; end
x=1; y=23.07;
th = linspace(0,pi/2,50);

a1 = line([a+x a+w-x],[b-40 b-40]);
a2 = line([a+x a+w-x],[b+40 b+40]);
a3 = line([a a],[b+40-y b-40+y]);
a4 = line([a+w a+w],[b-40+y b+40-y]);

c1 = line(a+x-x*cos(th),b-40+y-y*sin(th));
c2 = line(a+x-x*cos(th),b+40-y+y*sin(th));
c3 = line([a+w-x+x*cos(th) a+w-x-0.1],[b-40+y-y*sin(th) b-40]);
c4 = line([a+w-x+x*cos(th) a+w-x-0.1],[b+40-y+y*sin(th) b+40]);
output=[a1 a2 a3 a4 c1 c2 c3 c4];



