include_once 'Monome.php'; include_once 'Polynome.php'; $time_start = microtime(true); echo "<div class='row' style='text-align: center;'>"; $I3 = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]; $A = parseMatrice($_POST); echo printMatrice($A, "matriceF0", "A"); $trA = trace($A); $matF0tmp = multMatriceNumber($I3, $trA); $matF0tmp2 = subMatrices($A, $matF0tmp); $F1 = multMatrices($A, $matF0tmp2); echo printMatrice($F1, "F1", "F1"); $trF1 = trace($F1) / 2; $matF1tmp = multMatriceNumber($I3, $trF1); $matF1tmp2 = subMatrices($F1, $matF1tmp); $F2 = multMatrices($A, $matF1tmp2); echo printMatrice($F2, "F2", "F2"); $trF2 = trace($F2) / 3; echo "</div>"; $monomeCube = new Monome(-1, 3); $monomeCarre = new Monome($trA, 2); $monomeSimple = new Monome($trF1, 1); $monomeZero = new Monome($trF2, 0); $PA = new Polynome(array($monomeCube, $monomeCarre, $monomeSimple, $monomeZero)); $racines = racines($PA); echo "<div class='panel panel-warning'>" . "<div class='panel-heading'>" . "<h2 class='panel-title'>Polynôme</h2></div>" . "<div class='panel-body'><h3><strong>" . $PA . "</strong></h3></div></div>"; echo "<div class='panel panel-info'><div class='panel-heading'><h2 class='panel-title'>Racines</h2></div><div class='panel-body'>"; if (count($racines) == 1) { $res = factorizeOne($PA, $racines[0]); $factorise = $res["factorise"]; $factorise2 = $res["factorise2"];
function echelonnerRev() { global $matA; global $matY; $k = count($matA) - 1; while (!isFinished($matA[0]) && $k != 0) { $matG = initG($matA); if ($matA[$k][$k] === 0) { for ($i = $k - 1; $i >= 0; $i--) { if ($matA[$i][$k] != 0) { $matA[$k] = $matA[$i]; $matY[$k] = $matY[$i]; break; } } } for ($i = $k - 1; $i >= 0; $i--) { $matG[$i][$k] = -round($matA[$i][$k] / $matA[$k][$k], 2); } $matA = multMatrices($matG, $matA); $matY = multMatrices($matG, $matY); $matA = roundMatrice($matA); $matY = roundMatrice($matY); /* echo printMatrice($matG, "matGRev".$k, "G".-$k); echo printMatrice($matA, "matARev".(-$k+1), "A".(-$k+1)); echo printMatrice($matY, "matYRev".(-$k+1), "Y".(-$k+1));*/ $k--; } }
<title>Projet Matrices</title> <link rel="stylesheet" type="text/css" href="../css/bootstrap-spacelab.min.css"> <link rel="stylesheet" href="../css/maths.css"> </head> <body> <div class='jumbotron'> <h1>Le résultat du produit !</h1> </div> <main> <?php /** * @Author: cnicolas * @Date: 2014-08-05 15:56:30 * @Last Modified by: cnicolas * @Last Modified time: 2015-07-08 16:23:46 */ include 'fonctions.php'; $matA = parseMatrice($_POST, "A"); $matB = parseMatrice($_POST, "B"); $matRes = multMatrices($matA, $matB); echo printMatrice($matA, "matA", "A"); echo "<div class='col-sm-1'><h2>*</h2></div>"; echo printMatrice($matB, "matB", "B"); echo "<div class='col-sm-1'><h2>=</h2></div>"; echo printMatrice($matRes, "matRes", "Resultat"); ?> </main> <script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="../js/bootstrap.min.js"></script> </body> </html>