Graphics Reference
In-Depth Information
and the coordinates of the grid
x
p
=
pL/n
,
z
q
=
qL/n
:
n/
2
−
1
n/
2
−
1
h
pq
=
A
ij
cos(2
π
(
ip
+
jq
)
/n
−
ω
k
t
+
θ
ij
)
.
(13.11)
i
=
−n/
2+1
j
=
−n/
2+1
Next we write the cosine in terms of complex exponentials:
n/
2
−
1
n/
2
−
1
A
ij
2
e
√
−
1(2
π
(
ip
+
jq
)
/n−ω
k
t
+
θ
ij
)
h
pq
=
i
=
−n/
2+1
j
=
−n/
2+1
+
2
e
−
√
−
1(2
π
(
ip
+
jq
)
/n−ω
k
t
+
θ
ij
)
n/
2
−
1
n/
2
−
1
2
e
√
−
1(
θ
ij
−ω
k
t
)
A
ij
e
√
−
1(2
π
(
ip
+
jq
)
/n
)
1
=
i
=
−n/
2+1
j
=
−n/
2+1
+
2
e
−
√
−
1(
θ
ij
−ω
k
t
)
A
ij
e
√
−
1(2
π
(
−ip−jq
)
/n
)
(13.12)
Finally we shue terms around in the sum to get
n/
2
−
1
n/
2
−
1
2
e
√
−
1(
θ
ij
−ω
k
t
)
A
ij
+
2
e
−
√
−
1(
θ
−i,−j
−ω
k
t
)
A
−i,−j
h
pq
=
i
=
−n/
2+1
j
=
−n/
2+1
e
√
−
1(2
π
(
ip
+
jq
)
/n
)
×
n/
2
−
1
n/
2
−
1
Y
ij
(
t
)
e
√
−
1(2
π
(
ip
+
jq
)
/n
)
,
=
i
=
−n/
2+1
j
=
−n/
2+1
(13.13)
where the complex Fourier coecients
Y
ij
(
t
) are defined as
Y
ij
(
t
)=
2
e
√
−
1(
θ
ij
−ω
k
t
)
A
ij
+
2
e
−
√
−
1(
θ
−i,−j
−ω
k
t
)
A
−i,−j
=
2
cos(
θ
ij
−
ω
k
t
)+
√
−
ω
k
t
)
A
ij
1sin(
θ
ij
−
+
2
cos(
θ
−i,−j
−
−
√
−
ω
k
t
)
A
−i,−j
ω
k
t
)
1sin(
θ
ij
−
2
cos(
θ
ij
−
ω
k
t
)
A
−i,−j
ω
k
t
)
A
ij
+
2
cos(
θ
−i,−j
−
=
ω
k
t
)
A
−i,−j
(13.14)
In the last two line it's spelled out in real and imaginary parts. Evaluating
Equation (13.13) is exactly what FFT software is designed to do: all you
need to do is evaluate
Y
ij
(
t
)foreach
i
and
j
and pass in that 2D array
of
Y
values, getting back the heights. The results should be real, up to
round-off errors—you can safely ignore the imaginary parts, though a good
+
√
−
1
2
sin(
θ
ij
−
1
ω
k
t
)
A
ij
−
2
sin(
θ
−i,−j
−