comparison toolboxes/FullBNT-1.0.7/KPMtools/plot_ellipse.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 % PLOT_ELLIPSE
2 % h=plot_ellipse(x,y,theta,a,b)
3 %
4 % This routine plots an ellipse with centre (x,y), axis lengths a,b
5 % with major axis at an angle of theta radians from the horizontal.
6
7 %
8 % Author: P. Fieguth
9 % Jan. 98
10 %
11 %http://ocho.uwaterloo.ca/~pfieguth/Teaching/372/plot_ellipse.m
12
13 function h=plot_ellipse(x,y,theta,a,b)
14
15 np = 100;
16 ang = [0:np]*2*pi/np;
17 R = [cos(theta) -sin(theta); sin(theta) cos(theta)];
18 pts = [x;y]*ones(size(ang)) + R*[cos(ang)*a; sin(ang)*b];
19 h=plot( pts(1,:), pts(2,:) );