Personal tools
  •  

plotellipse.m

Document Actions
  • Bookmarks
  • CourseFeed

Click here to get the file

Size 1 kB - File type text/plain

File contents

             function [x] = plotellipse(A,x0,c)
% determine the points to plot an ellispe in two dimensions, 
% described by (x-x0)'*A*(x-x0) = c, where A is symmetric

dtheta = 0.1;
[u,d] = eig(A);
x = [];
d = inv(sqrt(d));
for theta = 0:dtheta:2*pi
  w = sqrt(c)*[cos(theta); sin(theta)];
  z = d*w;
  x = [x u*z + x0];
end
x = [x x(:,1)];
            
Copyright 2008, by the Contributing Authors. Cite/attribute Resource . admin. (2006, May 30). plotellipse.m. Retrieved January 07, 2011, from Free Online Course Materials — USU OpenCourseWare Web site: http://ocw.usu.edu/Electrical_and_Computer_Engineering/Stochastic_Processes/plotellipse.m-view.html. This work is licensed under a Creative Commons License Creative Commons License