]> AND Private Git Repository - these_gilles.git/blob - THESE/codes/snake/gvf_dist_v4.2c/examples/circle.m
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
19 sept
[these_gilles.git] / THESE / codes / snake / gvf_dist_v4.2c / examples / circle.m
1 function [x,y] = circle(delta)
2
3 hold on
4
5 % Loop, picking up the points
6 disp('Left mouse button picks the center.')
7 [s, t, but] = ginput(2);
8
9 cx = s(1); cy = t(1);
10 tx = s(2); ty = t(2);
11 R = sqrt((tx-cx).^2+(ty-cy).^2);
12
13 t = (0:delta:2*pi)';   
14 x = cx + R*cos(t);   
15 y = cy + R*sin(t); 
16
17 plot([x;x(1,1)],[y;y(1,1)],'r-');