Esempio n. 1
0
function echelonner()
{
    global $matA;
    global $matY;
    $k = 0;
    while (!isFinished($matA[count($matA) - 1]) && $k != count($matA) - 1) {
        $matG = initG($matA);
        if ($matA[$k][$k] === 0) {
            for ($i = $k + 1; $i < count($matA); $i++) {
                if ($matA[$i][$k] != 0) {
                    $matA[$k] = $matA[$i];
                    $matY[$k] = $matY[$i];
                    break;
                }
            }
        }
        for ($i = $k + 1; $i < count($matG); $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, "matG" . ($k + 1), "G" . ($k + 1));
        echo printMatrice($matA, "matA" . ($k + 2), "A" . ($k + 2));
        echo printMatrice($matY, "matY" . ($k + 2), "Y" . ($k + 2));
        $k++;
    }
}
Esempio n. 2
0
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"];
    $verif = $res["verification"];
Esempio n. 3
0
		<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 de la trace !</h1>
		</div>
		<main>
<?php 
/**
 * @Author: cnicolas
 * @Date:   2014-08-05 16:55:42
 * @Last Modified by:   cnicolas
 * @Last Modified time: 2015-07-08 16:20:26
 */
include 'fonctions.php';
$matA = parseMatrice($_POST, "A");
$res = 0;
for ($i = 0; $i < sizeof($matA); $i++) {
    $res += $matA[$i][$i];
}
echo "<div class='col-sm-2'><h2>Trace : </h2></div>";
echo printMatrice($matA, "matA", "A");
echo "<div class='col-sm-1'><h2>=</h2></div>";
echo "<div class=' col-sm-1'><h2>" . $res . "</h2></div>\n";
?>
		</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>
Esempio n. 4
0
	</head>
	<body>
		<div class='jumbotron'>
			<h1>Le résultat de la transposée !</h1>
		</div>
		<main>
<?php 
/**
 * @Author: cnicolas
 * @Date:   2014-08-05 16:39:26
 * @Last Modified by:   cnicolas
 * @Last Modified time: 2015-07-02 11:34:04
 */
include 'fonctions.php';
$matA = parseMatrice($_POST, "A");
$matRes;
for ($i = 0; $i < sizeof($matA); $i++) {
    for ($j = 0; $j < sizeof($matA[0]); $j++) {
        $matRes[$j][$i] = $matA[$i][$j];
    }
}
echo "<div class='col-sm-2'></div>";
echo printMatrice($matA, "matA", "A");
echo "<div class='col-sm-1'><h2>=</h2></div>";
echo printMatrice($matRes, "matRes", "Transposée");
?>
		</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>
Esempio n. 5
0
			<h1>Le résultat de la somme !</h1>
		</div>
		<main>
<?php 
/**
 * @Author: cnicolas
 * @Date:   2014-08-05 12:09:51
 * @Last Modified by:   cnicolas
 * @Last Modified time: 2015-07-02 11:34:06
 */
include 'fonctions.php';
$matA = parseMatrice($_POST, "A");
$matB = parseMatrice($_POST, "B");
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 "<div class='mat col-sm-3'>\n";
echo "<label for='res'>Resulat</label>\n";
echo "<table id='res' class='matrice table-bordered'>\n";
for ($i = 0; $i < sizeof($matA); $i++) {
    echo "<tr>\n";
    for ($j = 0; $j < sizeof($matA[$i]); $j++) {
        echo "<td class='casemat'>" . ($matA[$i][$j] + $matB[$i][$j]) . "</td>\n";
    }
    echo "</tr>\n";
}
echo "</table>\n";
echo "</div>\n";
?>
		</main>
Esempio n. 6
0
		<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>