/* L'exemple précédent amélioré... cette fois, on définit une transformation homothétie */ size(6cm,0); // Définition d'une tranformation homothétie transform Homothetie(real k, pair centre) { return shift(centre)*scale(k)*shift(-centre); } // Placement de 3 points donnés pair pA=(0,0),pB=(2,1),pC=(2,2); dot("$A$",pA,SW); dot("$B$",pB,S); dot("$C$",pC,N); // Définition de h, l'homothétie de centre pA et de rapport 1.5 transform h=Homothetie(1.5,pA); // Définition des image B' et C' de B et C par h pair imB=h*pB, imC=h*pC; // Construction de B' et C', des segments dot("$B'$",imB,SE,red);dot("$C'$",imC,NE,red); draw(imB--pA--imC,green); draw(pB--pC^^imB--imC,1bp+blue);