roots | R Documentation |
Roots of a polynomial
roots(x, method = c("polyroot", "eigen"))
x |
Polynomial coefficients with coefficients given in order from highest to lowest
polynomial power. This is the Matlab/Octave convention; it is
opposite of the convention used by |
method |
Either “polyroot” (default) which uses |
A complex array with the roots of the polynomial.
Original Octave version by Kurt Hornik. Conversion to R by Tom Short.
Octave Forge https://octave.sourceforge.io/
polyroot
, polyval
, poly
, conv
roots(1:3)
polyroot(3:1) # should be the same
poly(roots(1:3))
roots(1:3, method="eigen") # using eigenvalues
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.