1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
|
(*
±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
RگALISگ PAR: http://www.net.bsd-fan.com
POUR : TP DE MATH ( OPERATIONS SUR LES MATRICES, Addition,
Multiplication, Rsolution D'Un Systٹme D''گquations )
DATE : 11/04/2004, Derniٹre Mise A Jour -> 07/05/2004 /--h--
±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± *)
Program math_tp;
{$R test.res}
uses crt;
VAR m1,m2,m3:array[1..3,1..4] of real;
a,b,d:integer;dx1,dx2,dx3:real;c:char;
procedure affsystem;
begin
(* Affichage *)
gotoxy(62,7);write(' X1');
gotoxy(58,8);write(' x X2 =');
gotoxy(62,9);write(' X3');
for a:=1 to 3 do
for b:=1 to 3 do begin
gotoxy(40+(b*4),6+a);write(m1[a,b]:3:0);delay(70);
end;b:=4;
for a:=1 to 3 do begin
gotoxy(70,6+a);write(m1[a,b]:3:0);delay(70);
end;delay(500);
end;
procedure testretour;
begin
repeat
textcolor(103);textbackground(8);gotoxy(4,24);write(' ');
gotoxy(6,24);textcolor(7);
write('Autre Opration, Retour Au Menu, Ou Quitter ? [O/R/Q] :');
textcolor(yellow);
gotoxy(12,24);write('O');gotoxy(23,24);write('R');gotoxy(42,24);write('Q');
gotoxy(63,24);write(' ');
gotoxy(63,24);textcolor(white);textbackground(red);
gotoxy(63,24);write(' ');gotoxy(64,24);read(c);
until (c='R')or(c='r')or(c='O')or(c='o')or(c='Q')or(c='q');
end;
procedure lecmat1;
begin
gotoxy(5,5);write('Remlissage De La 1ٹre Matrice');
textcolor(103);gotoxy(6,24);write('');textcolor(7);gotoxy(8,24);
write('Veuillez Remplir Les Deux Matrices !');
for a:=1 to 3 do
for b:=1 to 3 do begin gotoxy(5+(b*4),8+a);readln(m1[a,b]);end;
end;
procedure affmat3;
begin
textcolor(white);
for a:=1 to 3 do
for b:=1 to 3 do begin gotoxy(50+(b*4),8+a);write(m3[a,b]:3:0);delay(100);end;
end;
procedure affsys;
begin
textcolor(7);
gotoxy(4,5);write('Le Systٹme D''گquations:');textcolor(yellow);
gotoxy(4,7);write('( ) X1+( ) X2+( ) X3=');
gotoxy(4,8);write('( ) X1+( ) X2+( ) X3=');
gotoxy(4,9);write('( ) X1+( ) X2+( ) X3=');
textcolor(103);gotoxy(6,24);write('');textcolor(7);gotoxy(8,24);
write('Veuillez Remplir Le Systٹme !');
for a:=1 to 3 do
for b:=1 to 4 do begin
gotoxy(-4+(b*10),6+a);read(m1[a,b]);
end;
end;
procedure enc;
begin
(* Encadrement *)
for a:=2 to 23 do begin
gotoxy(1,a);write('³');delay(5);
gotoxy(80,a);write('³');delay(5);end;
for a:=2 to 79 do begin
gotoxy(a,2);write('ؤ');delay(5);
gotoxy(a,23);write('ؤ');delay(5);end;
gotoxy(1,2);write('ع');gotoxy(80,2);write('؟');gotoxy(1,23);write('ہ');gotoxy(80,23);write('ظ');
(* Fin De l'Encadrement *)
end;
Begin
c:='o';
while (c='o') or (c='O') do begin
(* MENU PRINCIPALE *)
textbackground(8);textcolor(7);clrscr;enc;
gotoxy(5,4);write('OPگRATIONS SUR LES MATRICES');
gotoxy(5,5);write('MENU PRINCIPALE');delay(100);
gotoxy(10,10);write('A. Addition De Deux Matrices.');delay(100);
gotoxy(10,11);write('B. Multiplication De Deux Matrices.');delay(100);
gotoxy(10,12);write('C. Rsolution D''Un Systٹme D''گquations.');delay(100);
gotoxy(10,13);write('D. Quitter.');delay(100);
repeat
textcolor(103);textbackground(8);gotoxy(4,24);write(' ');
textcolor(7);gotoxy(6,24);
write('Entrez La Lettre De Votre Choix : ');
gotoxy(40,24);write(' ');
gotoxy(40,24);textcolor(white);textbackground(red);
gotoxy(40,24);write(' ');
gotoxy(41,24);read(c);
until (c='A')or(c='a')or(c='B')or(c='b')or(c='C')or(c='c')or(c='D')or(c='d');
case c of
'A','a':begin (* ADDITION DE DEUX MATRICES *)
c:='o';
while (c='o') or (c='O') do begin
textbackground(8);textcolor(white);clrscr;enc;
gotoxy(25,3);write('ADDITION DE DEUX MATRICES');textcolor(7);
(* Lecture m1,m2 + Traitement m1+m2 *)
lecmat1;
gotoxy(21,10);write('+');
gotoxy(5,18);write('1ٹre Matrice');
gotoxy(5,5);write('Remlissage De La 2ٹme Matrice');
for a:=1 to 3 do
for b:=1 to 3 do begin
gotoxy(21+(b*4),8+a);readln(m2[a,b]);m3[a,b]:=m2[a,b]+m1[a,b];end;
gotoxy(38,10);write('=');
gotoxy(25,18);write('2ٹme Matrice');
gotoxy(50,5);write('Rsolution De L''Addition');
(* Affichage m3 *)
affmat3;textcolor(white);
gotoxy(50,18);write('Rsultat De L''Addition');delay(1000);
testretour;
end;if (c='R')or(c='r') then c:='O';
end;
'B','b':begin (* MULTIPLICATION DE DEUX MATRICES *)
c:='o';
while (c='o') or (c='O') do begin
textbackground(8);textcolor(white);clrscr;enc;
gotoxy(25,3);write('MULTIPLICATION DE DEUX MATRICES');textcolor(7);
(* Lecture m1,m2 *)
lecmat1;
gotoxy(21,10);write('x');
gotoxy(5,18);write('1ٹre Matrice');
gotoxy(5,5);write('Remlissage De La 2ٹme Matrice');
for a:=1 to 3 do
for b:=1 to 3 do begin
gotoxy(21+(b*4),8+a);readln(m2[a,b]);
m3[a,b]:=m2[a,b]*m1[a,b];gotoxy(25,18);end;write('2ٹme Matrice');
(* Traitement m1*m2 *)
for a:=1 to 3 do
for b:=1 to 3 do begin
m3[a,b]:=0;
for d:=1 to 3 do m3[a,b]:=m3[a,b]+m1[a,d]*m2[d,b];
end;
textcolor(7);
gotoxy(38,10);write('=');
gotoxy(45,5);write('Rsolution De La Multiplication');
(* Affichage m3 *)
affmat3;textcolor(white);
gotoxy(45,18);write('Rsultat De La Multiplication');delay(1000);
testretour;
end;if (c='R')or(c='r') then c:='O';
end;
'C','c':begin
(* / RگSOLUTION D''UN SYSTشME D''گQUATIONS / *)
repeat
textbackground(8);textcolor(7);clrscr;enc;
gotoxy(5,4);write('OPگRATIONS SUR LES MATRICES');textcolor(white);
gotoxy(18,8);write('/ RگSOLUTION D''UN SYSTشME D''گQUATIONS /');delay(100);
textcolor(7);
gotoxy(8,12);write('1. Rsolution D''Un Systٹme Avٹc La Mthode De [GAUSS].');delay(100);
gotoxy(8,13);write('2. Rsolution D''Un Systٹme Avٹc La Mthode De [CRAMMER].');delay(100);
gotoxy(8,14);write('3. Rsolution D''Un Systٹme Avٹc La Mthode De [INVERSE D''UNE MATRICE].');delay(100);
gotoxy(8,15);write('4. Retour Au Menu Principale.');delay(100);
gotoxy(8,16);write('5. Quitter.');delay(100);
repeat
textcolor(103);textbackground(8);gotoxy(4,24);write(' ');
textcolor(7);gotoxy(6,24);
write('Entrez Le Numro De Votre Choix : ');
gotoxy(40,24);write(' ');
gotoxy(40,24);textcolor(white);textbackground(red);
gotoxy(40,24);write(' ');
gotoxy(41,24);read(c);
until (c='1')or(c='2')or(c='3')or(c='4')or(c='5');
case c of
'4':c:='o';
'5':c:='n';
'1':begin (* RگSOLUTION D''UN SYSTشME AVشC LA MگTHODE DE GAUSS *)
c:='o';
while (c='o') or (c='O') do begin
textbackground(8);textcolor(white);clrscr;enc;
gotoxy(15,3);write('RگSOLUTION D''UN SYSTشME AVشC LA MگTHODE DE [GAUSS]');
affsys;
(* Test De m1[1,1], m1[2,1], m1[3,1] *)
if (m1[1,1]=0)and(m1[2,1]<>0)
then begin
for a:=1 to 3 do
begin
m2[1,a]:=m1[1,a];m1[1,a]:=m1[2,a];
m1[2,a]:=m2[1,a];
end;
end
else if (m1[1,1]=0)and(m1[2,1]=0)and(m1[3,1]<>0)
then begin
for a:=1 to 3 do
begin
m2[1,a]:=m1[1,a];m1[1,a]:=m1[3,a];
m1[3,a]:=m2[1,a];
end;
end;
(* ????????????????????????????????? *)
(* Delta *)
m3[1,4]:=m1[2,2]*m1[3,3];m3[1,4]:=m3[1,4]-(m1[2,3]*m1[3,2]);m3[1,4]:=m1[1,1]*m3[1,4];
m3[1,4]:=m3[1,4]-(m1[1,2]*((m1[2,1]*m1[3,3])-(m1[2,3]*m1[3,1])));
m3[1,4]:=m3[1,4]+(m1[1,3]*((m1[2,1]*m1[3,2])-(m1[2,2]*m1[3,1])));
gotoxy(6,11);textcolor(white);write('Delta = [',m3[1,4]:3:0,']');
textcolor(103);gotoxy(6,20);
if m3[1,4]=0 then write('Pas De Solution !')
else begin textcolor(7);
(* Affichage *)
affsystem;
(* گlimination de x1 de 2 *)
if m1[2,1]=0 then begin
for a:=2 to 4 do
m2[3,a]:=m1[2,a];
end
else begin
for a:=1 to 4 do
m2[1,a]:=(-1*m1[2,1])*m1[1,a];
for a:=1 to 4 do
m2[2,a]:=m1[1,1]*m1[2,a];
for a:=1 to 4 do
m2[3,a]:=m2[1,a]+m2[2,a];end;
(* گlimination de x1 de 3 *)
if m1[3,1]=0 then begin
for a:=2 to 4 do
m3[3,a]:=m1[3,a];
end
else begin
for a:=1 to 4 do
m2[1,a]:=(-1*m1[3,1])*m1[1,a];
for a:=1 to 4 do
m2[2,a]:=m1[1,1]*m1[3,a];
for a:=1 to 4 do
m3[3,a]:=m2[1,a]+m2[2,a];end;
(* Affichage de 3 PRIME (SYSTEM 'I' PRIME) *)
textcolor(white);gotoxy(8,13);write('/ گlimination de x1 du 2,3 /');
textcolor(9);
gotoxy(4,15);write('( ) ( ) ( ) ');
gotoxy(4,16);write(' ( ) ( ) ');
gotoxy(4,17);write(' ( ) ( ) ');
textcolor(2);
gotoxy(13,15);write('+');gotoxy(23,15);write('+');gotoxy(33,15);write('=');
gotoxy(23,16);write('+');gotoxy(33,16);write('=');
gotoxy(23,17);write('+');gotoxy(33,17);write('=');
textcolor(white);
gotoxy(11,15);write('X1');gotoxy(21,15);write('X2');gotoxy(31,15);write('X3');
gotoxy(21,16);write('X2');gotoxy(31,16);write('X3');
gotoxy(21,17);write('X2');gotoxy(31,17);write('X3');
textcolor(11);
for a:=1 to 3 do begin
gotoxy(-4+(a*10),15);write(m1[1,a]:3:0);delay(70);end;
gotoxy(14+(a*7),15);write(m1[1,4]:3:0);delay(70);
for a:=2 to 3 do begin
gotoxy(-4+(a*10),16);write(m2[3,a]:3:0);delay(70);end;
gotoxy(14+(a*7),16);write(m2[3,4]:3:0);delay(70);
for a:=2 to 3 do begin
gotoxy(-4+(a*10),17);write(m3[3,a]:3:0);delay(70);end;
gotoxy(14+(a*7),17);write(m3[3,4]:3:0);delay(70);delay(500);
(* گlimination de x2 du 3 *)
if (m3[3,2]=0) then begin
for a:=3 to 4 do
m3[1,a]:=m1[3,a];
end
else begin
for a:=2 to 4 do
m2[1,a]:=(-1*m3[3,2])*m2[3,a];
for a:=2 to 4 do
m2[2,a]:=m2[3,2]*m3[3,a];
for a:=2 to 4 do
m3[1,a]:=m2[1,a]+m2[2,a];
(* Affichage de 3 PRIME(2) (SYSTEM 'I' PRIME(2)) *)
textcolor(white);gotoxy(50,13);write('/ گlimination de x2 du 3 /');
textcolor(9);
gotoxy(43,15);write('( ) ( ) ( ) ');
gotoxy(43,16);write(' ( ) ( ) ');
gotoxy(43,17);write(' ( ) ');
textcolor(2);
gotoxy(52,15);write('+');gotoxy(62,15);write('+');gotoxy(72,15);write('=');
gotoxy(62,16);write('+');gotoxy(72,16);write('=');
gotoxy(72,17);write('=');
textcolor(white);
gotoxy(50,15);write('X1');gotoxy(60,15);write('X2');gotoxy(70,15);write('X3');
gotoxy(60,16);write('X2');gotoxy(70,16);write('X3');
gotoxy(70,17);write('X3');
textcolor(11);
for a:=1 to 3 do begin
gotoxy(35+(a*10),15);write(m1[1,a]:3:0);delay(70);end;
gotoxy(53+(a*7),15);write(m1[1,4]:3:0);delay(70);
for a:=2 to 3 do begin
gotoxy(35+(a*10),16);write(m2[3,a]:3:0);delay(70);end;
gotoxy(53+(a*7),16);write(m2[3,4]:3:0);delay(70);
for a:=3 to 3 do begin
gotoxy(35+(a*10),17);write(m3[1,a]:3:0);delay(70);end;
gotoxy(53+(a*7),17);write(m3[1,4]:3:0);delay(70);delay(500);
(* Rsolution du x1,x2,x3 *)
end;
if (m3[1,3]=0)or(m1[1,1]=0) then begin
textcolor(103);gotoxy(6,20);write('Systٹme Non Rsolu, Division Par Le Zro !');
textcolor(white);gotoxy(4,21);write(' گvitez De Remplire x1 du 1,2,3 et x2 du 3, Par Le Zro !');
end
else begin
(*x3*) m2[1,1]:=m3[1,4]/m3[1,3];
(*x2*) m2[1,2]:=m2[3,4]-(m2[3,3]*m2[1,1]);
(*x1*) m3[3,3]:=(m1[1,4]-((m1[1,2]*m2[1,2])+(m1[1,3]*m2[1,1])))/m1[1,1];
textcolor(white);gotoxy(8,19);write(' En Utilisant La Mthode De [RگTRO GARDE],');
gotoxy(40,20);write(' On Obtient : ');delay(500);
gotoxy(60,19);writeln('X1 ',m3[3,3]:3:2);delay(500);
gotoxy(60,20);writeln('X2 ',m2[1,2]:3:2);delay(500);
gotoxy(60,21);writeln('X3 ',m2[1,1]:3:2);delay(500);
textcolor(111);
gotoxy(63,19);write('=');
gotoxy(63,20);write('=');
gotoxy(63,21);write('=');
end;end;testretour;
end;if (c='R')or(c='r') then c:='O';
end;
'2':begin (* RگSOLUTION D''UN SYSTشME AVشC LA MگTHODE DE CRAMMER *)
c:='o';
while (c='o') or (c='O') do begin
textbackground(8);textcolor(white);clrscr;enc;
gotoxy(15,3);write('RگSOLUTION D''UN SYSTشME AVشC LA MگTHODE DE [CRAMMER]');
affsys;
(* Delta *)
m3[1,4]:=m1[2,2]*m1[3,3];m3[1,4]:=m3[1,4]-(m1[2,3]*m1[3,2]);m3[1,4]:=m1[1,1]*m3[1,4];
m3[1,4]:=m3[1,4]-(m1[1,2]*((m1[2,1]*m1[3,3])-(m1[2,3]*m1[3,1])));
m3[1,4]:=m3[1,4]+(m1[1,3]*((m1[2,1]*m1[3,2])-(m1[2,2]*m1[3,1])));
gotoxy(6,11);textcolor(white);write('Delta = [',m3[1,4]:3:0,']');
textcolor(103);gotoxy(6,20);
if m3[1,4]=0 then write('Pas De Solution !')
else begin textcolor(7);
(* Affichage *)
affsystem;
(* Affichage *)
for a:=1 to 3 do
for b:=1 to 3 do begin
gotoxy(5+(b*4),13+a);write(m1[a,b]:3:0);delay(70);
end;
for a:=1 to 3 do
for b:=1 to 3 do begin
gotoxy(20+(b*4),13+a);write(m1[a,b]:3:0);delay(70);
end;
for a:=1 to 3 do
for b:=1 to 3 do begin
gotoxy(35+(b*4),13+a);write(m1[a,b]:3:0);delay(70);
end;delay(500);b:=4;textcolor(white);
(* DX1,DX2,DX3 *)
for a:=1 to 3 do begin
gotoxy(8,13+a);write(' ');gotoxy(9,13+a);write(m1[a,b]:3:0);delay(70);
end;
for a:=1 to 3 do begin
gotoxy(26+a,13+a);write(' ');gotoxy(28,13+a);write(m1[a,b]:3:0);delay(70);
end;
for a:=1 to 3 do begin
gotoxy(45+a,13+a);write(' ');gotoxy(47,13+a);write(m1[a,b]:3:0);delay(70);
end;
gotoxy(9,18);write('Delta X1');
gotoxy(24,18);write('Delta X2');
gotoxy(39,18);write('Delta X3');
(* Delta X1 *)
dx1:=m1[1,4]*((m1[2,2]*m1[3,3])-(m1[2,3]*m1[3,2]));
dx1:=dx1 - (m1[1,2]*((m1[2,4]*m1[3,3])-(m1[2,3]*m1[3,4])));
dx1:=dx1 + (m1[1,3]*((m1[2,4]*m1[3,2])-(m1[2,2]*m1[3,4])));
gotoxy(6,20);write('Delta X1 = (',dx1:2:2,') => X1 = ');
dx1:=dx1/m3[1,4];gotoxy(38,20);textcolor(103);write('[ ]');
textcolor(white);gotoxy(40,20);write(dx1:2:2);delay(700);
(* Delta X2 *)
dx2:=m1[1,1]*((m1[2,4]*m1[3,3])-(m1[2,3]*m1[3,4]));
dx2:=dx2 - (m1[1,4]*((m1[2,1]*m1[3,3])-(m1[2,3]*m1[3,1])));
dx2:=dx2 + (m1[1,3]*((m1[2,1]*m1[3,4])-(m1[2,4]*m1[3,1])));
gotoxy(6,21);write('Delta X2 = (',dx2:2:2,') => X2 = ');
dx2:=dx2/m3[1,4];gotoxy(38,21);textcolor(103);write('[ ]');
textcolor(white);gotoxy(40,21);write(dx2:2:2);delay(700);
(* Delta X3 *)
dx3:=m1[1,1]*((m1[2,2]*m1[3,4])-(m1[2,4]*m1[3,2]));
dx3:=dx3 - (m1[1,2]*((m1[2,1]*m1[3,4])-(m1[2,4]*m1[3,1])));
dx3:=dx3 + (m1[1,4]*((m1[2,1]*m1[3,2])-(m1[2,2]*m1[3,1])));
gotoxy(6,22);write('Delta X3 = (',dx3:2:2,') => X3 = ');
dx3:=dx3/m3[1,4];gotoxy(38,22);textcolor(103);write('[ ]');
textcolor(white);gotoxy(40,22);write(dx3:2:2);
end;testretour;
end;if (c='R')or(c='r') then c:='O';
end;
'3':begin (* RگSOLUTION D''UN SYSTشME AVشC LA MگTHODE DE INVERSE *)
c:='o';
while (c='o') or (c='O') do begin
textbackground(8);textcolor(white);clrscr;enc;
gotoxy(7,3);write('RگSOLUTION D''UN SYSTشME AVشC LA MگTHODE DE [L''INVشRSE D''UNE MATRICE]');
affsys;
(* Delta *)
m3[1,4]:=m1[2,2]*m1[3,3];m3[1,4]:=m3[1,4]-(m1[2,3]*m1[3,2]);m3[1,4]:=m1[1,1]*m3[1,4];
m3[1,4]:=m3[1,4]-(m1[1,2]*((m1[2,1]*m1[3,3])-(m1[2,3]*m1[3,1])));
m3[1,4]:=m3[1,4]+(m1[1,3]*((m1[2,1]*m1[3,2])-(m1[2,2]*m1[3,1])));
dx3:=m3[1,4];
gotoxy(6,11);textcolor(white);write('Delta = [',m3[1,4]:3:0,']');
textcolor(103);gotoxy(6,20);
if m3[1,4]=0 then write('Pas De Solution !')
else begin textcolor(7);delay(500);
(* Affichage *)
gotoxy(62,7);write(' X1');
gotoxy(58,8);write(' x X2 =');
gotoxy(62,9);write(' X3');
for a:=1 to 3 do
for b:=1 to 3 do begin
gotoxy(40+(b*4),6+a);write(m1[a,b]:3:0);
delay(70);end;
textcolor(white);gotoxy(50,11);write('A');textcolor(7);delay(500);
for a:=1 to 3 do begin
gotoxy(72,6+a);write(m1[a,b]:3:0);delay(70);
end;
textcolor(white);
gotoxy(74,11);write('B');
textcolor(7);delay(500);
(* INVERSE AT + Affichage *)
for a:=1 to 3 do
for b:=1 to 3 do begin
m2[a,b]:=m1[b,a];end;
for a:=1 to 3 do
for b:=1 to 3 do begin
gotoxy(2+(b*4),12+a);write(m2[a,b]:3:0);delay(70);end;
textcolor(white);gotoxy(7,17);write('A(Transpos)');
textcolor(7);
delay(500);
(* TRETEMENT *)
m3[1,1]:= (m2[2,2]*m2[3,3]) - (m2[2,3]*m2[3,2]);
m3[1,2]:=-1 * ( (m2[2,1]*m2[3,3]) - (m2[2,3]*m2[3,1]) ) ;
m3[1,3]:= (m2[2,1]*m2[3,2]) - (m2[2,2]*m2[3,1]);
m3[2,1]:=-1 * ( (m2[1,2]*m2[3,3]) - (m2[1,3]*m2[3,2]) ) ;
m3[2,2]:= (m2[1,1]*m2[3,3]) - (m2[1,3]*m2[3,1]);
m3[2,3]:=-1 * ( (m2[1,1]*m2[3,2]) - (m2[1,2]*m2[3,1]) ) ;
m3[3,1]:= (m2[1,2]*m2[2,3]) - (m2[1,3]*m2[2,2]);
m3[3,2]:=-1 * ( (m2[1,1]*m2[2,3]) - (m2[1,3]*m2[2,1]) ) ;
m3[3,3]:= (m2[1,1]*m2[2,2]) - (m2[1,2]*m2[2,1]);
for a:=1 to 3 do
for b:=1 to 3 do begin
gotoxy(20+(b*4),12+a);write(m3[a,b]:3:0);delay(70);end;
textcolor(white);gotoxy(25,17);write('A(Adjointe)');
textcolor(7);delay(500);
(* sauveguarde de m1 [1,2,3 : 4] sur m2 *)
for a:=1 to 3 do begin
m2[a,4]:=m1[a,4];
end;
(**)
for a:=1 to 3 do
for b:=1 to 3 do m1[a,b]:=(1/dx3)*m3[a,b];
for a:=1 to 3 do
for b:=1 to 3 do begin
gotoxy(42+(b*7),12+a);write(m1[a,b]:3:2);delay(70);end;
textcolor(white);gotoxy(42,17);write('A(Inverse) = 1/Delta x A(Adjointe)');
textcolor(7);delay(500);
for a:=1 to 3 do begin
m3[1,a]:=0;
for b:=1 to 3 do begin
m3[1,a]:=m3[1,a]+(m1[a,b]*m2[b,4]);
end;end;
(* Affichage *)
textcolor(111);
gotoxy(58,19);write('=');
gotoxy(58,20);write('=');
gotoxy(58,21);write('=');
gotoxy(44,20);write('=>');textcolor(white);
gotoxy(62,19);write('X1');
gotoxy(62,20);write('X2');
gotoxy(62,21);write('X3');
gotoxy(7,20);write('A(Inverse) x A x X = A(Inverse) x B');
textcolor(7);
for a:=1 to 3 do begin
gotoxy(30+(b*7),18+a);write(m3[1,a]:3:2);delay(500);
end;end;testretour;
(* FIN *)
end;if (c='R')or(c='r') then c:='O';
end;
end;
until (c='o')or(c='n')or(c='q')or(c='Q');
end;
'F','f':c:='n';
end;
end;
textcolor(white);textbackground(black);clrscr;enc;
gotoxy(10,21);write('http://www.net.bsd-fan.com');
gotoxy(10,5);write('.FIN DU PROGRAMME RENCONTRگ !');delay(2500);
end. |
Partager