Mercurial > hg > mauch-mirex-2010
annotate _FullBNT/KPMtools/plot_ellipse.m @ 9:4ea6619cb3f5 tip
removed log files
author | matthiasm |
---|---|
date | Fri, 11 Apr 2014 15:55:11 +0100 |
parents | b5b38998ef3b |
children |
rev | line source |
---|---|
matthiasm@8 | 1 % PLOT_ELLIPSE |
matthiasm@8 | 2 % h=plot_ellipse(x,y,theta,a,b) |
matthiasm@8 | 3 % |
matthiasm@8 | 4 % This routine plots an ellipse with centre (x,y), axis lengths a,b |
matthiasm@8 | 5 % with major axis at an angle of theta radians from the horizontal. |
matthiasm@8 | 6 |
matthiasm@8 | 7 % |
matthiasm@8 | 8 % Author: P. Fieguth |
matthiasm@8 | 9 % Jan. 98 |
matthiasm@8 | 10 % |
matthiasm@8 | 11 %http://ocho.uwaterloo.ca/~pfieguth/Teaching/372/plot_ellipse.m |
matthiasm@8 | 12 |
matthiasm@8 | 13 function h=plot_ellipse(x,y,theta,a,b) |
matthiasm@8 | 14 |
matthiasm@8 | 15 np = 100; |
matthiasm@8 | 16 ang = [0:np]*2*pi/np; |
matthiasm@8 | 17 R = [cos(theta) -sin(theta); sin(theta) cos(theta)]; |
matthiasm@8 | 18 pts = [x;y]*ones(size(ang)) + R*[cos(ang)*a; sin(ang)*b]; |
matthiasm@8 | 19 h=plot( pts(1,:), pts(2,:) ); |