PHP Classes
elePHPant
Icontem

File: binomial.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Israel de Souza Rocha  >  bNewton  >  binomial.php  >  Download  
File: binomial.php
Role: Example script
Content type: text/plain
Description: Example how to use
Class: bNewton
Solve equations using Newton's binomial theorem
Author: By
Last change:
Date: 10 years ago
Size: 1,016 bytes
 

Contents

Class file image Download
<?
include("binomial.class.php");
?>
Newton's binomial<br>
Negative sample:<br>
(5x - 54y)<sup>3</sup> =
<?

$b
= new bNewton();
// show the solution to binomial
// you can use the negative signal in second parameter too

$b->calculate('5x', '-45y', 3);
// sample to calculate a binomial number
?>
<br>
Positive sample:<br>
(2a + 3b)<sup>4</sup> =
<?
$b
= new bNewton();
// show the solution to binomial
// you can use the negative signal in second parameter too

$b->calculate('2a', '3b', 4);
// sample to calculate a binomial number
?>
<br><br>
Binomial number
<table border="0" cellpading="0" cellspacing="0">
    <tr>
        <td rowspan="2"><big><big><big><big>(</big></big></big></big></td>
        <td>9</td>
        <td rowspan="2"><big><big><big><big>)</big></big></big></big></td>
        <td rowspan="2"> =
        <?
       
echo $b->binomialNumber(9,4);
       
?>
        </td>
    </tr>
    <tr>
        <td>4</td>
    </tr>
</table>

<br><br>
Fatorial
<br>

5! =
<?
// fatorial sample
echo $b->fat(5);


?>