Skip to content

Commit 01fae2f

Browse files
committed
Vector spaces for Disks
1 parent ecd43a1 commit 01fae2f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/test_diskvector.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using MultivariateOrthogonalPolynomials, Test, ForwardDiff
2+
using ForwardDiff: gradient
3+
4+
5+
k = 0; m = 0; n = 2
6+
7+
Z_x = 𝐱 -> gradient(𝐱 -> zernikez(n,m,𝐱), 𝐱)[1]
8+
Z_y = 𝐱 -> gradient(𝐱 -> zernikez(n,m,𝐱), 𝐱)[2]
9+
10+
11+
𝐱 = SVector(0.1,0.2)
12+
r = norm(𝐱); θ = atan(𝐱[2], 𝐱[1])
13+
z = 2r^2 - 1
14+
zernikez(n,m,𝐱)
15+
16+
W = (n,a,b) -> 2^(a+b+1)/(2n+a+b+1) * gamma(n+a+1)gamma(n+b+1)/(gamma(n+a+b+1)factorial(n))
17+
18+
@test jacobip(n,k, m,z) / sqrt(W(n,k,m)) normalizedjacobip(n,k,m,z)
19+
20+
r^m * cos(m*θ) * jacobip(n,k, m,z) / sqrt(W(n,k,m) / 2^(2+k+m))
21+
22+
sqrt(π) * zernikez(n,m,𝐱)
23+
24+
@time expand(Zernike(), Z_x)
25+

0 commit comments

Comments
 (0)