[scilab-Users] transforming the polynomial variable
Samuel Gougeon
Samuel.Gougeon at univ-lemans.fr
Mon Nov 1 21:04:55 CET 2010
Hi,
Sam Mathew <sam at cctech.co.in> a écrit :
> Given a polynomial function, how can one find another polynomial function
> which is obtained by translating the variable by a constant parameter.
>
> For e.g., if,
> Velocity = 2 + 3*x + 5*x^2,
>
> if the origin is shifted to say, (2,3), in the positive direction, i.e., x
> is to be replaced by x-2; is there a built-in function for finding the
> Velocity function (in polynomial form) in the new coordinate system?
Let
Velocity = poly([2 3 5],"z","coeff")
Velocity =
2
2 + 3z + 5z
Then :
NewVelocity = horner(Velocity,%z-2)
-->NewVelocity = horner(Velocity,%z-2)
NewVelocity =
2
16 - 17z + 5z
// %z is a predefined variable. If you prefer "x", do first
x = poly(0,"x")
> Is it possible to extend it to polynomials in two variables?
Yes, with some work. But it is not yet available in Scilab itself
(maybe in an external module. Likely through Maxima)
> Is it possible to also perform such transformations if a function is of two
> variables x and y, and the coordinate axes undergo different transformations
> (translation, rotation, etc.).
It could be, whether the polynomial could be applied to a
matrix (it can) in a matrix way. But it is not the case :
horner() works on a matrix only in a element-wise way.
Regards
Samuel
More information about the users
mailing list