Login   Register  
PHP Classes
elePHPant
Icontem

File: examples.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tacek  >  PHPolynomials  >  examples.php  >  Download  
File: examples.php
Role: Example script
Content type: text/plain
Description: Examples
Class: PHPolynomials
Perform math operations with polynomials
Author: By
Last change:
Date: 2007-04-30 10:14
Size: 598 bytes
 

Contents

Class file image Download
<?
include("polynomials.php");
$polynomials=new polynomials;

//Use lowercase!
//For powers use (base^expponent)
//instead of fractions 1/x use (x^-1)

//Removing brackets
$polynomials->remove_brackets('-1(2(b^2)+2x-1a(-2+3x)+3x+4(2))');
echo(
$polynomials->output);

//Multiply polynomials
$output=$polynomials->multiply_polynomials('4abc','5(a^2)');
echo(
"<br>".$output);

//Divide polynomials
$polynomials=new polynomials;
$output=$polynomials->divide_polynomials('2(a^3)b','ab');
echo(
"<br>".$output);

//Show html code
echo("<br>".$polynomials->polynom2html($output));
?>