19
19
# For the storage pattern of the arrays, please consult the
20
20
# [documentation](https://MikaelSlevinsky.github.io/FastTransforms).
21
21
22
- using FastTransforms, LinearAlgebra
22
+ using FastTransforms, LinearAlgebra, Plots
23
23
24
24
# Our function $f$ on the disk:
25
25
f = (x,y) -> (x^ 2 - y^ 2 + 1 )/ ((x^ 2 - y^ 2 + 1 )^ 2 + (2 x* y+ 1 )^ 2 )
26
26
27
27
# The Zernike polynomial degree:
28
- N = 5
28
+ N = 20
29
29
M = 4 N- 3
30
30
31
31
# The radial grid:
@@ -37,6 +37,29 @@ r = [sinpi((N-n-0.5)/(2N)) for n in 0:N-1]
37
37
# On the mapped tensor product grid, our function samples are:
38
38
F = [f (r* cospi (θ), r* sinpi (θ)) for r in r, θ in θ]
39
39
40
+ # We superpose the grid on top of a contour plot of $f$:
41
+ X = [r* cospi (θ) for r in r, θ in θ]
42
+ Y = [r* sinpi (θ) for r in r, θ in θ]
43
+
44
+ # PyPlot
45
+ pyplot ()
46
+ contourf (X, Y, F; levels= 30 , linewidth= 2 , xlabel= " x" , ylabel= " y" )
47
+ scatter! (X, Y; legend= false , markercolor= :red , size= (600 , 600 ))
48
+
49
+ # bis
50
+ scatter3d (vec (X), vec (Y), vec (0 X); markersize= 2.0 , markercolor= :red , size= (600 , 600 ))
51
+ surface! (X, Y, F; legend= false , xlabel= " x" , ylabel= " y" )
52
+
53
+ # PlotlyJS
54
+ plotlyjs ()
55
+ scatter3d (vec (X), vec (Y), vec (0 X); markersize= 0.5 , markercolor= :red , size= (600 , 600 ))
56
+ surface! (X, Y, F; legend= false , xlabel= " x" , ylabel= " y" )
57
+
58
+ # GR
59
+ gr ()
60
+ scatter3d (vec (X), vec (Y), vec (0 X); markersize= 0.5 , markercolor= :red , size= (600 , 600 ))
61
+ surface! (vec (X), vec (Y), vec (F); legend= false , xlabel= " x" , ylabel= " y" )
62
+
40
63
# We precompute a (generalized) Zernike--Chebyshev×Fourier plan:
41
64
α, β = 0 , 0
42
65
P = plan_disk2cxf (F, α, β)
@@ -85,6 +108,29 @@ z = [sinpi((M-2m-1)/(2M)) for m in 0:M-1]
85
108
# On the mapped tensor product grid, our function samples are:
86
109
F = [f (x[n], w[n]* z) for n in 1 : N, z in z]
87
110
111
+ # We superpose the grid on top of a contour plot of $f$:
112
+ X = [x for x in x, z in z]
113
+ Y = [w* z for w in w, z in z]
114
+
115
+ # PyPlot
116
+ pyplot ()
117
+ contourf (X, Y, F; levels= 30 , linewidth= 2 , xlabel= " x" , ylabel= " y" )
118
+ scatter! (X, Y; legend= false , markercolor= :green , size= (600 , 600 ))
119
+
120
+ # bis
121
+ scatter3d (vec (X), vec (Y), vec (0 X); markersize= 2.0 , markercolor= :green , size= (600 , 600 ))
122
+ surface! (X, Y, F; legend= false , xlabel= " x" , ylabel= " y" )
123
+
124
+ # PlotlyJS
125
+ plotlyjs ()
126
+ scatter3d (vec (X), vec (Y), vec (0 X); markersize= 0.5 , markercolor= :green , size= (600 , 600 ))
127
+ surface! (X, Y, F; legend= false , xlabel= " x" , ylabel= " y" )
128
+
129
+ # GR
130
+ gr ()
131
+ scatter3d (vec (X), vec (Y), vec (0 X); markersize= 0.5 , markercolor= :green , size= (600 , 600 ))
132
+ surface! (vec (X), vec (Y), vec (F); legend= false , xlabel= " x" , ylabel= " y" )
133
+
88
134
# We precompute a Dunkl-Xu--Chebyshev plan:
89
135
P = plan_rectdisk2cheb (F, β)
90
136
0 commit comments