solve.polynomial: Zeros of a Polynomial

Description Usage Arguments Details Value See Also Examples

Description

Find the zeros, if any, of a given polynomial.

Usage

1
2
## S3 method for class 'polynomial'
solve(a, b, ...)

Arguments

a

A polynomial object for which the zeros are required.

b

a numeric value specifying an additional intercept. If given, the zeros of a - b are found.

...

Not used by this method.

Details

This is a method for the generic function solve.

The zeros are found as the eigenvalues of the companion matrix, sorted according to their real parts.

Value

A numeric vector, generally complex, of zeros.

See Also

polyroot, poly.calc, summary.polynomial

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
p <- polynomial(6:1)
p
## 6 + 5*x + 4*x^2 + 3*x^3 + 2*x^4 + x^5 
pz <- solve(p)
pz
## [1] -1.49180+0.0000i -0.80579-1.2229i -0.80579+1.2229i
## [4]  0.55169-1.2533i  0.55169+1.2533i
## To retrieve the original polynomial from the zeros:
poly.calc(pz)
## Warning: imaginary parts discarded in coercion
## 6 + 5*x + 4*x^2 + 3*x^3 + 2*x^4 + x^5

eestileib/ComplexPoly documentation built on May 16, 2019, 12:13 a.m.