Глава 9. Многочлены в GEL

Содержание

Использование многочленов

В настоящее время Genius может работать с многочленами одной переменной, записанными в виде векторов, и выполнять некоторые основные операции с ними. В будущем планируется расширить их поддержку.

Использование многочленов

Currently polynomials in one variable are just horizontal vectors with value only nodes. The power of the term is the position in the vector, with the first position being 0. So,

[1,2,3]

translates to a polynomial of

1 + 2*x + 3*x^2

You can add, subtract and multiply polynomials using the AddPoly, SubtractPoly, and MultiplyPoly functions respectively. You can print a polynomial using the PolyToString function. For example,

PolyToString([1,2,3],"y")

gives

3*y^2 + 2*y + 1

You can also get a function representation of the polynomial so that you can evaluate it. This is done by using PolyToFunction, which returns an anonymous function.

f = PolyToFunction([0,1,1])
f(2)

It is also possible to find roots of polynomials of degrees 1 through 4 by using the function PolynomialRoots, which calls the appropriate formula function. Higher degree polynomials must be converted to functions and solved numerically using a function such as FindRootBisection, FindRootFalsePosition, FindRootMullersMethod, or FindRootSecant.

See «Многочлены» in the function list for the rest of functions acting on polynomials.