Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

polytrans

Polynomial Transformations


Description

Transform a polynomial, find a greatest common factor, or determine the multiplicity of a root.

Usage

polytrans(p, q)

polygcf(p, q, tol = 1e-12)

Arguments

p, q

vectors representing two polynomials.

tol

tolerance for coefficients to tolerate.

Details

Transforms polynomial p replacing occurences of x with another polynomial q in x.

Finds a greatest common divisor (or factor) of two polynomials. Determines the multiplicity of a possible root; returns 0 if not a root. This is in general only true to a certain tolerance.

Value

polytrans and polygcf return vectors representing polynomials. rootsmult returns a natural number (or 0).

Note

There are no such functions in Matlab or Octave.

See Also

Examples

# (x+1)^2 + (x+1) + 1
polytrans(c(1, 1, 1), c(1, 1))    #=> 1 3 3
polytrans(c(1, 1, 1), c(-1, -1))  #=> 1 1 1

p <- c(1,-1,1,-1,1)         #=>  x^4 - x^3 + x^2 - x + 1
q <- c(1,1,1)               #=>  x^2 + x + 1
polygcf(polymul(p, q), q)   #=>  [1] 1 1 1

p = polypow(c(1, -1), 6)    #=>  [1] 1  -6  15 -20  15  -6   1
rootsmult(p, 1)             #=>  [1] 6

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.