function plot_ellipse(c,v_a,v_b,nP,varargin) % PLOTH Plot of an ellipse % h = PLOT_ELLIPSE( c,a,b,nP ) plot nP points of an ellipse % % INPUTS: % c - [ scalar ], center % a - [ 3x1 or 1x3 ], first axis % b - [ 3x1 or 1x3 ], second axis % nP - [ scalar ], number of points % % OUTPUTS % H - handle % example: % plot_ellipse([10,10],[1,0],[0,1],100) % axis equal % % See also plotH. % Copyright None. % $Revision: 1.0 $ $Date: 2005/20/apr % $Author: F. Patanč t=[0:nP-1]'/(nP-1)*2*pi; p=[cos(t) sin(t)]; p=p*([v_a(:),v_b(:)])'; p(:,1)=c(1)+p(:,1); p(:,2)=c(2)+p(:,2); if nargin>4 plot(p(:,1),p(:,2),varargin{:}) else plot(p(:,1),p(:,2)); end