Function: math[makepoly] - generates a polynom from a list of coefficients or a set of solutions
Calling Sequence:
makepoly(l, x, p);
makepoly(s, x, p);
Parameters:
l
- a list of coefficients
s
- a set of solutions
x
- (optional) the indeterminate in the resulting polynom
p
- (optional) a name
Description:
In the first form, makepoly generates a polynom
from a list l := [
, ...,
] of values
of type algebraic (the coefficients of the polynom to be built).
In the second form, by passing a set s :={
, ...,
} of values of type algebraic as the first argument, makepoly creates a polynom by applying the formula (x-
) * (x-
) * ... * (x-
).
By default, the indeterminate in the resulting polynom is the name 'x'. You may choose another indeterminate by passing it as the second argument.
By specifying the optional third argument - a name -, the resulting polynom is assigned to that name.
This function is part of the math package, and so can be used only after performing the command with(math) or with(math, makepoly).
Examples:
> with(math, makepoly):
> poly := makepoly([1, 2, 3], x, p);
> p;
> sols := solve(poly=0, x);
> makepoly({sols});
> makepoly([1, 0, 0, c]); # skip powers x^2 and x^1.
See Also:
math/cutzeros , math/cancel for numerical adjustments.
Version History:
Version 1.0 - as of February 26, 1998
Version 1.1 - as of January 01, 1999