summary.polynomial.RdSummarize a polynomial by describing its “key” points.
# S3 method for class 'polynomial'
summary(object, ...)A list of class "summary.polynomial" (which has its own
print method) containing information on zeros, stationary and
inflexion points.
This is a method for the generic function summary.
p <- polynomial(6:1)
p
#> 6 + 5*x + 4*x^2 + 3*x^3 + 2*x^4 + x^5
## 6 + 5*x + 4*x^2 + 3*x^3 + 2*x^4 + x^5
pz <- summary(p)
pz
#>
#> Summary information for:
#> 6 + 5*x + 4*x^2 + 3*x^3 + 2*x^4 + x^5
#>
#> Zeros:
#> [1] -1.4917980+0.000000i -0.8057865-1.222905i -0.8057865+1.222905i
#> [4] 0.5516855-1.253349i 0.5516855+1.253349i
#>
#> Stationary points:
#> [1] -0.85825757-0.5132192i -0.85825757+0.5132192i 0.05825757-0.9983016i
#> [4] 0.05825757+0.9983016i
#>
#> Points of inflexion:
#> [1] -0.7211424+0.00000i -0.2394288-0.70523i -0.2394288+0.70523i
## [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: longer object length is not a multiple of shorter object length
#> Warning: longer object length is not a multiple of shorter object length
#> Warning: imaginary parts discarded in coercion
#> 0.9233124 + 2.072266*x + 5.862637*x^2 + 4.444231*x^3 + 2.253262*x^4 -
#> 0.5543656*x^5 + 1.027714*x^6 + x^7
## Warning: imaginary parts discarded in coercion
## 6 + 5*x + 4*x^2 + 3*x^3 + 2*x^4 + x^5