polyval | R Documentation |
Evaluate a polynomial at given points.
polyval(coef, z)
coef |
coefficients of the polynomial, defined in decreasing power. |
z |
the points at which to evaluate the polynomial. |
An array of length(z)
, the polynomial evaluated at each element
of z
.
Tom Short
poly
, roots
polyval(c(1, 0, -2), 1:3) # s^2 - 2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.