wolffd@0: % PLOT_ELLIPSE wolffd@0: % h=plot_ellipse(x,y,theta,a,b) wolffd@0: % wolffd@0: % This routine plots an ellipse with centre (x,y), axis lengths a,b wolffd@0: % with major axis at an angle of theta radians from the horizontal. wolffd@0: wolffd@0: % wolffd@0: % Author: P. Fieguth wolffd@0: % Jan. 98 wolffd@0: % wolffd@0: %http://ocho.uwaterloo.ca/~pfieguth/Teaching/372/plot_ellipse.m wolffd@0: wolffd@0: function h=plot_ellipse(x,y,theta,a,b) wolffd@0: wolffd@0: np = 100; wolffd@0: ang = [0:np]*2*pi/np; wolffd@0: R = [cos(theta) -sin(theta); sin(theta) cos(theta)]; wolffd@0: pts = [x;y]*ones(size(ang)) + R*[cos(ang)*a; sin(ang)*b]; wolffd@0: h=plot( pts(1,:), pts(2,:) );