LagrangeBasis - Lagrange polynomials on a set of nodes
|
Calling Sequence
|
|
LagrangeBasis(k, nodes, x)
|
|
Parameters
|
|
k
|
-
|
algebraic expression; the index
|
nodes
|
-
|
list of algebraic expressions; the nodes where the polynomial is known
|
x
|
-
|
algebraic expression; the argument
|
|
|
|
|
Examples
|
|
>
|
|
| (1) |
>
|
|
![p := 3*LagrangeBasis(0, [-1, -1/3, 1/3, 1], x)+5*LagrangeBasis(2, [-1, -1/3, 1/3, 1], x)+7*LagrangeBasis(3, [-1, -1/3, 1/3, 1], x)](/support/helpjp/helpview.aspx?si=8527/file00088/math102.png)
| (2) |
That polynomial has the value 3 at , the value 0 at , the value 5 at , and the value 7 at .
>
|
|
![P := Record(Value = Default[value], Variable = x, Degree = 3, Coefficient = coe, Dimension = [1, 1], Basis = LagrangeBasis, BasisParameters = [[-1, -1/3, 1/3, 1]], IsMonic = mon, OutputOptions = [shape = [], storage = rectangular, order = Fortran_order, fill = 0, attributes = []])](/support/helpjp/helpview.aspx?si=8527/file00088/math119.png)
| (3) |
>
|
|
| (4) |
Note that the result returned by represents a matrix polynomial; hence these results are 1 by 1 matrices.
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
|
|