% $URL: svn+ssh://aaron@birenboim.com/home/users/svn/Jansen/trunk/plotKlann.m $
% $Id: plotKlann.m 52 2013-05-10 15:44:11Z aaron $
% plot a Kann linkage, given standard node locations
function plotKlann(nodes,sym,lw)
if (nargin < 2), sym = 'b'; end
if (nargin < 3), lw = 1; end
bw = lw+2;  % fixed arm linewidth
if (lw == 1), bw=1; end

% A is origin
B=nodes(1:2);
C=nodes(3:4);
D=nodes(5:6);
E=nodes(7:8);
F=nodes(9:10);
G=nodes(11:12);
H=nodes(13:14);
%hold off;
%plot([A(1),C(1),H(1),F(1),E(1),D(1)],...
%     [A(2),C(2),H(2),F(2),E(2),D(2)],sym,'linewidth',lw);
plot([C(1),H(1),F(1)],[C(2),H(2),F(2)],sym,'linewidth',lw+2); % rocker arm
hold on;
plot([E(1),F(1),G(1)],[E(2),F(2),G(2)],sym,'linewidth',lw+2); % leg
plot([0,C(1)],[0,C(2)],sym,'linewidth',lw);
plot([B(1),H(1)],[B(2),H(2)],sym,'linewidth',lw);
plot([D(1),E(1)],[D(2),E(2)],sym,'linewidth',lw);
plot([0,B(1),D(1)],[0,B(2),D(2)],'ko'); % fixed nodes
end
