Skip to contents

generate legendre matrix

Usage

get_legendre_matrix(x, legendre_order)

Arguments

x

vector equal to the x value for legendre polynomials(in this case times)

legendre_order

the order of legendre polynomials

Value

the polynomials value of each order

Examples

get_legendre_matrix(1:14,4)
#>        legendre_1  legendre_2 legendre_3  legendre_4
#>  [1,] -1.00000000  1.00000000 -1.0000000  1.00000000
#>  [2,] -0.84615385  0.57396450 -0.2453345 -0.06718952
#>  [3,] -0.69230769  0.21893491  0.2089213 -0.41731732
#>  [4,] -0.53846154 -0.06508876  0.4173873 -0.34449074
#>  [5,] -0.38461538 -0.27810651  0.4346837 -0.08399566
#>  [6,] -0.23076923 -0.42011834  0.3154301  0.18770351
#>  [7,] -0.07692308 -0.49112426  0.1142467  0.35296383
#>  [8,]  0.07692308 -0.49112426 -0.1142467  0.35296383
#>  [9,]  0.23076923 -0.42011834 -0.3154301  0.18770351
#> [10,]  0.38461538 -0.27810651 -0.4346837 -0.08399566
#> [11,]  0.53846154 -0.06508876 -0.4173873 -0.34449074
#> [12,]  0.69230769  0.21893491 -0.2089213 -0.41731732
#> [13,]  0.84615385  0.57396450  0.2453345 -0.06718952
#> [14,]  1.00000000  1.00000000  1.0000000  1.00000000