https://github.com/cran/pracma
Raw File
Tip revision: 63f12837f2d7d6d30cdc2b2df60efdef228d8d0f authored by HwB on 10 May 2011, 00:00:00 UTC
version 0.4-0
Tip revision: 63f1283
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{polydef}}, \code{\link{compan}}
}
\examples{
  roots(c(1, 0, 1, 0, 0))       # 0 0 1i -1i
  p <- polydef(c(-2, -1, 0, 1, 2))
  roots(p)
}
\keyword{ math }
back to top