https://github.com/cran/pracma
Tip revision: d5bfb0e3b7a3211ff2bbe2926e5ba31aa24e4df6 authored by HwB on 09 March 2012, 00:00:00 UTC
version 1.0.1
version 1.0.1
Tip revision: d5bfb0e
roots.Rd
\name{roots}
\alias{roots}
\title{Polynomial Roots}
\description{
Computes the roots of the polynomial \code{p}.
}
\usage{
roots(p)
}
\arguments{
\item{p}{vector of real numbers representing the polynomial}
}
\details{
For solution the function computes the eigenvalues of the companion matrix.
At the moment, only real coefficients are allowed.
}
\value{
a vector holding the roots of the polynomial
}
\seealso{
\code{\link{polyroot}}
}
\examples{
roots(c(1, 0, 1, 0, 0)) # 0 0 1i -1i
p <- poly(c(-2, -1, 0, 1, 2))
roots(p)
}
\keyword{ math }