% tel2.m
% fd, 05 novembre 2006, 05 mars 2025 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   clear ; format long 

   fprintf ('test2 : meme probleme que tel1 mais avec deux autres points \n') ;

xa = 1 ; ya = .5 ; xb = 1 ; yb = 0 ; 
hold off 
plot ( [xa , xb] , [ya , yb ] , '*b;;') 
axis ( [ .5 , 1.5 , -.25  , .75 ] , 'square' ) ;
hold on ; 
abx = xb - xa ; aby = yb - ya ; 
aa = sqrt ( abx**2 + aby**2 ) ; 
nx = -aby ; ny = abx ; 
rr=aa/sqrt(3) ; 
xc = xa + .5*abx - 1 / (2*sqrt(3))*nx ; 
yc = ya + .5*aby - 1 / (2*sqrt(3))*ny ; 
plot ( xc , yc , 'or;;') 
cbx = xb - xc ; cby = yb - yc ; 


n=200 ; cercle=zeros(2,n+1) ; 
dth = 2*pi / (3*n) ; theta = 0 ; 
for j=1:n+1; 
cercle(1,j:j) = xc + (cos(theta)*cbx - sin(theta)*cby) ; 
cercle(2,j:j) = yc + (cos(theta)*cby + sin(theta)*cbx) ; 
theta = theta + dth ; end ; 
plot ( cercle(1:1,:) , cercle(2:2,:) , 'k;;')


title ('l angle des demi-droites aux deux points bleus vaut 2*pi/3') ;
print('05-geometrie-cartesienne', '-djpg','-S891,630'); 
 
