function plot_inductor(n,w,A,B) % % plot_inductor(n,w,A,B) plots an inductor, % starting at position A and ending at B. % % ON ENTRY: % n number of loops in the coil; % w width of the coil, amplitude; % A x and y coordinates of start position; % B x and y coordinates of end position. % % EXAMPLE: % plot_inductor(5,0.4,[1,1],[2,1]) % axis([0 3 0 2]) % x = -1:0.01:1; % define for A=[-1,0], B=[+1,0] t = (x+1)*pi*(n+0.5); y = -w*sin(t); x = x + 0.15*(1-cos(t)); a = x(1); b = x(length(x)); x = 2*(x-a)/(b-a) - 1; [xx,yy] = coordinate_transformation(x,y,A,B); plot(xx,yy);