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

change.origin

Change Origin for a Polynomial


Description

Calculate the coefficients of a polynomial relative to a new origin on the x axis.

Usage

change.origin(p, o)

Arguments

p

an object of class "polynomial".

o

a numeric scalar representing the new origin on the original scale.

Details

Let P(x) = ∑_i p_i x^i be a given polynomial and consider writing P(x) = ∑_j q_j (x - o)^j. This function calculates the coefficients q_j and returns the result as a polynomial.

Value

A polynomial with coefficients relative to the re-located x axis.

Examples

pr <- poly.calc(1:5)
pr
## -120 + 274*x - 225*x^2 + 85*x^3 - 15*x^4 + x^5
change.origin(pr, 3)
## 4*x - 5*x^3 + x^5

polynom

A Collection of Functions to Implement a Class for Univariate Polynomial Manipulations

v1.4-0
GPL-2
Authors
Bill Venables [aut, cre] (S original), Kurt Hornik [aut] (R port), Martin Maechler [aut] (R port)
Initial release

We don't support your browser anymore

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