09 Mei 2019

ALJABAR LINIER DENGAN METODE GAUSS JORDAN BAHASA PHP



Source Code :

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. </head>
  6. <body>
  7. <table>
  8. <tr>
  9. <td>
  10. <?php
  11. $a = 1;
  12. $b = -1;
  13. $c = -1;
  14. $d = 0;
  15. $e = 6;
  16. $f = 2;
  17. $g = 0;
  18. $h = 12;
  19. $i = 6;
  20. $j = 0;
  21. $k = 3;
  22. $l = 8;
  23. ?>
  24. Soal =
  25. <table>
  26. <tr>
  27. <td>X<small>1</small> -</td>
  28. <td>X<small>2</small> -</td>
  29. <td>X<small>3</small></td>
  30. <td>= 0</td>
  31. </tr>
  32. <tr>
  33. <td>6X<small>1</small> +</td>
  34. <td>2X<small>2</small></td>
  35. <td> </td>
  36. <td>= 12</td>
  37. </tr>
  38. <tr>
  39. <td>6X<small>1</small> </td>
  40. <td>+</td>
  41. <td>3X<small>3</small></td>
  42. <td>= 8</td>
  43. </tr>
  44. </table>

  45. <br>
  46. <table>
  47. <tr>
  48. <td>
  49. <table>
  50. <tr>
  51. <td><center>| <?= $a ?></center></td>
  52. <td><center><?= $b ?></center></td>
  53. <td><center><?= $c ?></center></td>
  54. <td><center><?= $d ?> |</center></td>
  55. </tr>
  56. <tr>
  57. <td><center>| <?= $e ?></center></td>
  58. <td><center><?= $f ?></center></td>
  59. <td><center><?= $g ?></center></td>
  60. <td><center><?= $h ?> |</center></td>
  61. </tr>
  62. <tr>
  63. <td><center>| <?= $i ?></center></td>
  64. <td><center><?= $j ?></center></td>
  65. <td><center><?= $k ?></center></td>
  66. <td><center><?= $l ?> |</center></td>
  67. </tr>
  68. </table>
  69. </td>
  70. <td>
  71. B<small>2</small> - 6B<small>1</small>
  72. </td>
  73. </tr>
  74. </table>

  75. <?php
  76. $E = $e - (6*$a);
  77. $F = $f - (6*$b);
  78. $G = $g - (6*$c);
  79. $H = $h - (6*$d);
  80. ?>
  81. <br>
  82. <table>
  83. <tr>
  84. <td>
  85. <table>
  86. <tr>
  87. <td><center>| <?= $a ?></center></td>
  88. <td><center><?= $b ?></center></td>
  89. <td><center><?= $c ?></center></td>
  90. <td><center><?= $d ?> |</center></td>
  91. </tr>
  92. <tr>
  93. <td><center>| <?= $E ?></center></td>
  94. <td><center><?= $F ?></center></td>
  95. <td><center><?= $G ?></center></td>
  96. <td><center><?= $H ?> |</center></td>
  97. </tr>
  98. <tr>
  99. <td><center>| <?= $i ?></center></td>
  100. <td><center><?= $j ?></center></td>
  101. <td><center><?= $k ?></center></td>
  102. <td><center><?= $l ?> |</center></td>
  103. </tr>
  104. </table>
  105. </td>
  106. <td>
  107. B<small>3</small> - 6B<small>1</small>
  108. </td>
  109. </tr>
  110. </table>

  111. <?php
  112. $I = $i - (6*$a);
  113. $J = $j - (6*$b);
  114. $K = $k - (6*$c);
  115. $L = $l - (6*$d);
  116. ?>
  117. <br>
  118. <table>
  119. <tr>
  120. <td>
  121. <table>
  122. <tr>
  123. <td><center>| <?= $a ?></center></td>
  124. <td><center><?= $b ?></center></td>
  125. <td><center><?= $c ?></center></td>
  126. <td><center><?= $d ?> |</center></td>
  127. </tr>
  128. <tr>
  129. <td><center>| <?= $E ?></center></td>
  130. <td><center><?= $F ?></center></td>
  131. <td><center><?= $G ?></center></td>
  132. <td><center><?= $H ?> |</center></td>
  133. </tr>
  134. <tr>
  135. <td><center>| <?= $I ?></center></td>
  136. <td><center><?= $J ?></center></td>
  137. <td><center><?= $K ?></center></td>
  138. <td><center><?= $L ?> |</center></td>
  139. </tr>
  140. </table>
  141. </td>
  142. <td>
  143. B<small>3</small> - <?= (3/4) ?>B<small>2</small>
  144. </td>
  145. </tr>
  146. </table>

  147. <?php
  148. $II = $I - ((3/4)*$E);
  149. $JJ = $J - ((3/4)*$F);
  150. $KK = $K - ((3/4)*$G);
  151. $LL = $L - ((3/4)*$H);
  152. ?>
  153. <br>
  154. <table>
  155. <tr>
  156. <td>
  157. <table>
  158. <tr>
  159. <td><center>| <?= $a ?></center></td>
  160. <td><center><?= $b ?></center></td>
  161. <td><center><?= $c ?></center></td>
  162. <td><center><?= $d ?> |</center></td>
  163. </tr>
  164. <tr>
  165. <td><center>| <?= $E ?></center></td>
  166. <td><center><?= $F ?></center></td>
  167. <td><center><?= $G ?></center></td>
  168. <td><center><?= $H ?> |</center></td>
  169. </tr>
  170. <tr>
  171. <td><center>| <?= $II ?></center></td>
  172. <td><center><?= $JJ ?></center></td>
  173. <td><center><?= $KK ?></center></td>
  174. <td><center><?= $LL ?> |</center></td>
  175. </tr>
  176. </table>
  177. </td>
  178. </tr>
  179. </table>
  180. </td>
  181. <td>
  182. <table>
  183. <tr>
  184. <td><?= $KK ?> X<small>3</small> = <?= $LL ?></td>
  185. </tr>
  186. <tr>
  187. <td>X<small>3</small> = (<?= $LL/$KK ?>)</td>
  188. </tr>
  189. </table>
  190. <br>
  191. <table>
  192. <tr>
  193. <td><?= $F ?>X<small>2</small> + <?= $G ?> (<?= $LL/$KK ?>) = <?= $H ?></td>
  194. </tr>
  195. <tr>
  196. <td><?= $F ?>X<small>2</small> + (<?= $G*($LL/$KK) ?>) = <?= $H ?></td>
  197. </tr>
  198. <tr>
  199. <td><?= $F ?>X<small>2</small> = <?= $H ?> + <?= ($G*($LL/$KK))*(-1) ?></td>
  200. </tr>
  201. <tr>
  202. <td><?= $F ?>X<small>2</small> = <?= $H+($G*($LL/$KK))*(-1) ?></td>
  203. </tr>
  204. <tr>
  205. <td>X<small>2</small> = <?= ($H+($G*($LL/$KK))*(-1))/$F ?></td>
  206. </tr>
  207. </table>
  208. <br>
  209. <table>
  210. <tr>
  211. <td>X<small>1</small> - <?= ($H+($G*($LL/$KK))*(-1))/$F ?> - (<?= $LL/$KK ?>) = <?= $d ?></td>
  212. </tr>
  213. <tr>
  214. <td>X<small>1</small> - <?= ($H+($G*($LL/$KK))*(-1))/$F ?> + <?= ($LL/$KK)*(-1) ?> = <?= $d ?></td>
  215. </tr>
  216. <tr>
  217. <td>X<small>1</small> = <?= ($H+($G*($LL/$KK))*(-1))/$F ?> - <?= ($LL/$KK)*(-1) ?> = <?= (($H+($G*($LL/$KK))*(-1))/$F)-(($LL/$KK)*(-1)) ?></td>
  218. </tr>
  219. <tr>
  220. <td>X<small>1</small> = <?= (($H+($G*($LL/$KK))*(-1))/$F)-(($LL/$KK)*(-1)) ?></td>
  221. </tr>
  222. </table>
  223. </td>
  224. </tr>
  225. </table>


  226. </body>
  227. </html>
kaffi. Diberdayakan oleh Blogger.