How can I convert a polynomial to another coordinate system?

Using complex matrix mathematics, I solved a system of equations leading to coefficients for a polynomial of degree n '

Ax^(n-1) + Bx^(n-2) + ... + Z 

Then I think about a polynomial over a given range of x, in fact, I make a polynomial curve. Now here is the catch. I did this work in one coordinate system, which we will call the "data space". Now I need to imagine the same curve in a different coordinate space. It is easy to convert input / output to and from coordinate spaces, but the end user is only interested in the coefficients [A, B, ...., Z], since they can independently restore the polynomial. As I can imagine the second set of coefficients [A ', B', ...., Z '], which represent the same formula curve in a different coordinate system.

If that helps, I work in 2D space. Plain old x and y. I also feel that this may include multiplying the coefficients by the transformation matrix? Will it include a scaling / translation factor between coordinate systems? Will it be the inverse matrix? I feel like I'm heading in the right direction ...

Update: coordinate systems are linearly related. It would be useful to know, and ??

+6
language-agnostic math algorithm geometry transform
source share
5 answers

The statement about the problem is somewhat fuzzy, so first I will clarify my own interpretation:

You have a polynomial function

f (x) = C n x n + C n-1 x n-1 sup> + ... + C 0

[I changed A, B, ... Z to C n , C n-1 , ..., C 0 more easily to work with linear algebra below.]

Then you also have a transformation, such as: z = ax + b that you want to use to find the coefficients for the same polynomial, but in terms of z:

f (z) = D n z n + D n-1 z n-1 sup> + ... + D 0

This can be done quite easily with some linear algebra. In particular, you can define a matrix (n + 1) and times; (n + 1) T, which allows us to perform matrix multiplication

d = T * c ,

where d is the column vector with the top input D 0 , for the last record D n , the column vector c is similar for C i , and the matrix T has the (i, j) th [i th row, j th column] record t ij given

t ij = (j select i) a i b ji .

Where (j selects i) is the binomial coefficient, and = 0 for i> j. Also, unlike standard matrices, I think that i, j each range from 0 to n (usually you start with 1).

This is basically a good way to write out the extension and recompression of the polynomial by manually connecting z = ax + b and using the binomial theorem .

+4
source share

Tyler's answer is the correct answer if you need to calculate this change in the variable z = ax + b many times (I mean for many different polynomials). On the other hand, if you need to do this only once, it is much faster to combine the calculation of the matrix coefficients with the final estimate. The best way to do this is to symbolically evaluate your polynomial at (ax + b) at the Herner method:

  • you save the coefficients of the polynomial in the vector V (at the beginning all the coefficients are zero), and for i = n - 0, you multiply it by (ax + b) and add C i .
  • adding C i means adding it to a constant member
  • multiplying by (ax + b) means multiplying all the coefficients by b by the vector K 1 , multiplying all the coefficients by a and shifting them from the constant term by the vector K 2 and putting K 1 + K 2 back to V.

It will be easier to program and calculate faster.

Note that changing y to w = cy + d is really easy. Finally, as the matiouast points out, a general change of coordinates will not give you a polynomial.

Tech note : if you still want to calculate the matrix T (as defined by Tyler), you must calculate it using a weighted version of the Pascal rule (this is what Hรถrner's calculation does)

t i, j = bt i, j-1 + at i-1, j-1

That way you just compute it, column by column from left to right.

+3
source share

If I understand your question correctly, there is no guarantee that after changing the coordinates the function will remain polynomial. For example, let y = x ^ 2, and the new coordinate system x '= y, y' = x. Now the equation becomes y '= sqrt (x'), which is not a polynomial.

+2
source share

You have an equation:

 y = Ax^(n-1) + Bx^(n-2) + ... + Z 

In the space xy, and you want it in some space x'y. You need the conversion functions f (x) = x 'and g (y) = y' (or h (x ') = x and j (y') = y). In the first case, you need to solve for x and solve for y. When you have x and y, you can replace these results with your original equation and solve for y '.

Regardless of whether this is trivial, depends on the complexity of the functions used to convert from one space to another. For example, equations such as:

 5x = x' and 10y = y' 

extremely easy to decide for the result

 y' = 2Ax'^(n-1) + 2Bx'^(n-2) + ... + 10Z 
0
source share

If the input spaces are linearly connected, then yes, the matrix should be able to transform one set of coefficients into another. For example, if you had your polynomial in your "original" x-space:

ax ^ 3 + bx ^ 2 + cx + d

and you wanted to convert to another w-space, where w = px + q

then you want to find ', b', c 'and d' so that

ax ^ 3 + bx ^ 2 + cx + d = a'w ^ 3 + b'w ^ 2 + c'w + d '

and with some algebra,

a'w ^ 3 + b'w ^ 2 + c'w + d '= a'p ^ 3x ^ 3 + 3a'p ^ 2qx ^ 2 + 3a'pq ^ 2x + a'q ^ 3 + b'p ^ 2x ^ 2 + 2b'pqx + b'q ^ 2 + c'px + c'q + d '

so

a = a'p ^ 3

b = 3a'p ^ 2q + b'p ^ 2

c = 3a'pq ^ 2 + 2b'pq + c'p

d = a'q ^ 3 + b'q ^ 2 + c'q + d '

which can be rewritten as a matrix problem and solved.

-one
source share

All Articles