% Home Map
%
% This script will take the basic measurements and create a
% two-dimensional map of a home.  Each wall (interior and
% exterior) will be a five-element vector.  The first four
% elements will be the x & y coordinates of the beginning and
% ends of each end of the wall.  The fifth element will be
% the width of the line drawn to show that particular wall.
% In general, thicker lines denote exterior walls and thinner
% lines denote interior walls.
% This can later be enhanced to show windows and doors, perhaps
% using a cell-array to change line colors, thus more easily
% visualizing a building layout.

clear

% Exterior walls

wall{1}=[0,0,14.33,0,5];
wall{2}=[14.33,0,14.33,13.07,5];
wall{3}=[14.33,13.07,7.26,13.07,5];
wall{4}=[7.26,13.07,7.26,6.95,5];
wall{5}=[7.26,6.95,5.43,6.95,5];
wall{6}=[5.43,6.95,5.43,7.56,5];
wall{7}=[5.43,7.56,0,7.56,5];
wall{8}=[0,7.56,0,0,5];

% Interior walls

wall{9}=[2.98,0,2.98,3.76,2];
wall{10}=[2.98,3.76,6.07,3.76,2];
wall{11}=[6.07,3.76,6.07,0,2];
wall{12}=[5.34,3.76,5.34,4.62,2];
wall{13}=[5.34,4.62,6.07,4.62,2];
wall{14}=[7.26,4.62,9.92,4.62,2];
wall{15}=[9.92,4.62,9.92,13.07,2];
wall{16}=[7.26,6.27,9.92,6.27,2];
wall{17}=[7.26,7.77,9.92,7.77,2];
wall{18}=[7.26,9.23,8.4,9.23,2];
wall{19}=[7.26,10.83,9.92,10.83,2];
wall{20}=[9.92,0,9.92,3.72,2];
wall{21}=[14.33,3.79,11.21,3.79,2];
wall{22}=[14.33,8.24,11.21,8.24,2];
wall{23}=[7.26,4.62,7.26,6.95,2];
wall{24}=[11.21,3.13,11.94,3.13,2];
wall{25}=[11.94,7.63,11.21,7.63,2];
wall{26}=[11.21,3.13,11.21,8.24,2];
wall{27}=[11.94,7.63,11.94,8.23,2];
wall{28}=[11.94,3.13,11.94,3.79,2];

wallNum=length(wall);
cn=1;
figure(1)
x=[wall{cn}(1) wall{cn}(3)];
y=[-wall{cn}(2) -wall{cn}(4)];
thick=wall{cn}(5);
sizefig(1200,1200);
plot(x,y,'k-','linewidth',thick);
xlim([-1,15]);
ylim([-15,1]);
hold on;
for(ii=2:wallNum);
    cn=cn+1;
    x=[wall{cn}(1) wall{cn}(3)];
    y=[-wall{cn}(2) -wall{cn}(4)];
    thick=wall{cn}(5);
    plot(x,y,'k-','linewidth',thick);
end
hold off;
axis equal;