2323# For the storage pattern of the arrays, please consult the
2424# [documentation](https://MikaelSlevinsky.github.io/FastTransforms).
2525
26- using FastTransforms, LinearAlgebra
26+ using FastTransforms, LinearAlgebra, Plots
27+ const GENFIGS = joinpath (dirname (dirname (pathof (FastTransforms))), " docs/src/generated" )
28+ ! isdir (GENFIGS) && mkdir (GENFIGS)
29+ plotlyjs ()
2730
2831# Our function $f$ and the Cartesian components of its gradient:
2932f = (x,y) -> 1 / (1 + x^ 2 + y^ 2 )
3033fx = (x,y) -> - 2 x/ (1 + x^ 2 + y^ 2 )^ 2
3134fy = (x,y) -> - 2 y/ (1 + x^ 2 + y^ 2 )^ 2
3235
3336# The polynomial degree:
34- N = 10
37+ N = 15
3538M = N
3639
3740# The parameters of the Proriol series:
@@ -56,6 +59,16 @@ w = [sinpi((2M-2m-1)/(4M))^2 for m in 0:M-1]
5659# On the mapped tensor product grid, our function samples are:
5760F = [f (x[n+ 1 ], x[N- n]* w[m+ 1 ]) for n in 0 : N- 1 , m in 0 : M- 1 ]
5861
62+ # We superpose a surface plot of $f$ on top of the grid:
63+ X = [x for x in x, w in w]
64+ Y = [x[N- n]* w[m+ 1 ] for n in 0 : N- 1 , m in 0 : M- 1 ]
65+ scatter3d (vec (X), vec (Y), vec (0 F); markersize= 0.75 , markercolor= :green , size= (800 , 600 ))
66+ surface! (X, Y, F; legend= false , xlabel= " x" , ylabel= " y" , zlabel= " f" )
67+ savefig (joinpath (GENFIGS, " proriol.html" ))
68+ # ##```@raw html
69+ # ##<object type="text/html" data="../proriol.html" style="width:100%;height:600px;"></object>
70+ # ##```
71+
5972# We precompute a Proriol--Chebyshev² plan:
6073P = plan_tri2cheb (F, α, β, γ)
6174
0 commit comments