function plot_switch(s,h,A,B) % % plot_switch(s,h,A,B) plots a switch, % of size s and relative height h, % starting at position A and ending at B. % % ON ENTRY: % s size of the switch is the gap; % h relative height of the switch, % the height of the opening is h*s; % A x and y coordinates of start position; % B x and y coordinates of end position. % % EXAMPLE: % plot_switch(0.4,1.2,[1,1],[2,1]) % axis([0 3 0 2]); % x1 = [-1,-0.5*s,0.5*s]; % first leg -/ y1 = h*[0,0,0.5*s]; x2 = [0.5*s,1]; % second leg - y2 = [0,0]; if(ishold == 0) hold on; end; [xx1,yy1] = coordinate_transformation(x1,y1,A,B); [xx2,yy2] = coordinate_transformation(x2,y2,A,B); plot(xx1,yy1); plot(xx2,yy2);