We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b47598 commit 03125d3Copy full SHA for 03125d3
examples/padua.jl
@@ -0,0 +1,26 @@
1
+#############
2
+# This demonstrates the Padua transform and inverse transform,
3
+# explaining precisely the normalization and points
4
5
+
6
+using FastTransforms
7
8
+N = 15
9
+pts = paduapoints(N)
10
+x = pts[:,1]; y = pts[:,2]
11
12
+f = (x,y) -> exp(x + cos(y))
13
+f̌ = paduatransform(f.(x , y))
14
+f̃ = (x,y) -> begin
15
+ j = 1
16
+ ret = 0.0
17
+ for n in 0:N, k in 0:n
18
+ ret += f̌[j]*cos((n-k)*acos(x)) * cos(k*acos(y))
19
+ j += 1
20
+ end
21
+ ret
22
+end
23
24
+f̃(0.1,0.2) ≈ f(0.1,0.2)
25
26
+ipaduatransform(f̌) ≈ f̃.(x,y)
0 commit comments