-
Notifications
You must be signed in to change notification settings - Fork 4
compute polynomial
kgryte edited this page May 12, 2015
·
1 revision
Evaluates a polynomial whose coefficients are defined by coef
. x
may be either a single numeric
value or an array
of values at which to evaluate to the polynomial.
var coef = [ 4, 2, 6, -17 ];
var vals = compute.polyval( coef, [ 10, -3] );
// returns [ 4243, -125 ]
For object arrays
, provide an accessor function
for accessing array
values.
var coefs = [ 4, 2, 6, -17 ];
var data = [
['beep', 10],
['boop', -3]
];
function getValue( d, i ) {
return d[ 1 ];
}
var vals = compute.polyval( coefs, data, {
'accessor': getValue
});
// returns [ 4243, -125 ]
For additional options
, see compute-polynomial.
- Utilities
- Array Creation
- Sorting and Reshaping Arrays
- Special Functions
- Arithmetic
- Relational Operations
- Logical Operations
- Trigonometry
- Geometry
- Sets
- Discrete Mathematics
- Linear Algebra
- Statistics