Graph: ezcGraphPolynom
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcGraphPolynom
|
Provides a class for generic operations on polynoms [
source]
Member Variables
|
protected array |
$values
Factors of the polynom |
Method Summary
Methods
__construct
Constructor
Constructs a polynom object from given array, where the key is the exponent and the value the factor. An example: Polynom: 2 * x^3 + .5 * x - 3 Array: array ( (int) 3 => (float) 2, (int) 1 => (float) .5, (int) 0 => (float) -3, )
Parameters
| Name |
Type |
Description |
$values |
array |
Array with values |
add
Adds polynom to current polynom
Parameters
evaluate
float evaluate(
float
$x )
Evaluate Polynom with a given value
Parameters
| Name |
Type |
Description |
$x |
float |
Value |
get
float get(
int
$exponent )
Return factor for one exponent
Parameters
| Name |
Type |
Description |
$exponent |
int |
Exponent |
getOrder
int getOrder(
)
Returns the order of the polynom
init
Initialise a polygon
Initialise a polygon of the given order. Sets all factors to 0.
Parameters
| Name |
Type |
Description |
$order |
int |
Order of polygon |
set
Set the factor for one exponent
Parameters
| Name |
Type |
Description |
$exponent |
int |
Exponent |
$factor |
float |
Factor |
__toString
string __toString(
)
Returns a string represenation of the polynom
Last updated: Mon, 17 Dec 2007