Source for file Polynomial_examples.php
Documentation is available at Polynomial_examples.php
header('Content-type: text/plain');
include 'Math/Polynomial.php';
include 'Math/PolynomialOp.php';
print ("\n-- Algebra --\n");
print ('P is: ' . $p->toString () . "\n");
print ('Q is: ' . $q->toString () . "\n");
print ('P multiplied by Q is: ' . $mul->toString () . "\n"); // Print string representation
print ('The degree of that result is: ' . $mul->degree () . "\n");
print ('P minus Q is: ' . $sub->toString () . "\n");
print ('R is: ' . $r->toString () . "\n");
print ('S is: ' . $s->toString () . "\n");
print ('R divided by S is: ' . $div->toString () . ' ( remainder of: ' . $remainder->toString () . ' )' . "\n");
print ("\n-- Creating Polynomials --\n");
print ('Here is a polynomial with the roots 1, 2, and -3: ' . $roots->toString () . "\n");
print ("\n-- Derivatives --\n");
print ('f(x) is: ' . $p->toString () . "\n");
print ('f\'(x) is: ' . $der1->toString () . ' (first derivative)' . "\n");
print ('f\'\'(x) is: ' . $der2->toString () . ' (second derivative)' . "\n");
Documentation generated on Mon, 11 Mar 2019 14:38:25 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|