%
% resist(orient)
%
function rlen = resist(c,orient,rlab,alab)
R = [0 0; 1 0; 1.2 .25; 1.6 -.25; 2 .25; 2.4 -.25; 2.6 0; 3.6 0];
R = R';
r = max(R(1,:));     % length of a resistor
if strcmp(orient,'h')
    plot(c(1)+R(1,:),c(2)+R(2,:),'k','linewidth',1.5)
    hold on
    text(c(1)+1.8,c(2)+0.5,rlab)%,'fontsize',20)
    if strcmp(alab,' ') == 0
        a = [0 0; r/2 0; r/2-r/6 .1; r/2 0; r/2-r/6 -.1];
        a = a';
        plot(c(1)+.9+a(1,:),c(2)-0.5+a(2,:),'k','linewidth',1)
        text(c(1)+1,c(2)-1,alab)%,'fontsize',20)
    end
else
    rot = [0 1;-1 0];
    V = rot*R;
    plot(c(1)+V(1,:),c(2)+V(2,:),'k','linewidth',1.5)
    hold on
    text(c(1)+0.5,c(2)-2,rlab)%,'fontsize',20)
    if strcmp(alab,' ') == 0
        a = [0 0; r/2 0; r/2-r/6 .1; r/2 0; r/2-r/6 -.1];
        a = a';
        a = rot*a;
        plot(c(1)-.7+a(1,:),c(2)-0.75+a(2,:),'k','linewidth',1)
        text(c(1)-1.7,c(2)-1.3,alab)%,'fontsize',20)
    end
end
hold on
axis equal
return