Swap polynomial indeterminates
swap(p, variable, replacement)
p | polynomial |
---|---|
variable | the variable in the polynomial to replace |
replacement | the replacement variable |
a mpoly object
#> x^2 + 2 x y + y^2swap(p, "x", "t")#> t^2 + 2 t y + y^2#> 10 x^3 - 20 x^4 + 10 x^5(p2 <- swap(p, "x", "t"))#> 10 t^3 - 20 t^4 + 10 t^5is.bernstein(p2)#> [1] TRUE#> -3 x + 4 x^3(p2 <- swap(p, "x", "t"))#> -3 t + 4 t^3is.chebyshev(p2)#> [1] TRUE