
% for the first session example

clear all;
clf


% getting the image
subplot(1,2,1);
a=imread('cardio.png');
image(a);

axis equal tight



% get the data
d=load('cardio.dat');
x=d(:,1); y=d(:,2);

hold on
plot(x,y,'b*-','linewidth',2);


% comparison with the formula
% change of reference frame
x0=260; y0=199;
x=x-x0; y=y-y0;

pixsize=2/(260-77);

x=x*pixsize;
y=y*pixsize;
y=-y;


% plot this data
subplot(1,2,2);
plot(x,y,'b*-');



% the formula
theta=linspace(0,2*pi,1000);
r=1-cos(theta);
xx=r.*cos(theta);
yy=r.*sin(theta);

hold on
plot(xx,yy,'k-');

axis equal tight














