0

I have been trying to implement this Wave equation into java:

A = amplitude of wave L = wave length w = spatial angular frequency s = speed wt = temporal angular frequency d = direction FI = initiatory phase

$$Y(x,y,t)=A\cdot\cos(w \cdot(x,y)+ wt\cdot t + FI)$$

I understand that it returns a Vector. But I am unsure as to what this section of the formula means:

$$w \cdot(x,y)$$

I believe that $w$ is a vector. But I'm not whether its a 3D Vector or 2D Vector, and how it is used.

Source: http://lnu.diva-portal.org/smash/get...412/FULLTEXT01

wythagoras
  • 25,026
  • The link gives: ...ERROR...ERROR...ERROR...ERROR...ERROR...ERROR...ERROR... An error occurred... – copper.hat Feb 03 '14 at 07:22
  • http://lnu.diva-portal.org/smash/get/diva2:205412/FULLTEXT01 –  Feb 03 '14 at 07:47
  • 1
    It might be a bit much to expect folks to read a 66 page technical report to answer your question. You might consider giving relevant page numbers. – copper.hat Feb 03 '14 at 07:50
  • Didnt ask them to. I only asked them to explain that one formula. The link is merely for people who are interested in the subject. –  Feb 03 '14 at 07:51
  • I would guess that it is a two dimensional vector and the * means inner product? – copper.hat Feb 03 '14 at 07:57
  • So Vector2f w * vector2f(x,y)? –  Feb 03 '14 at 08:03

1 Answers1

0

The general equation for a planar wave in 3D is of the form $E : \mathbb{R}^{4} \rightarrow \mathbb{C}$, where

$$ E( \mathbf{r}, t ) = E_0 \cos \left( \omega t + \mathbf{k}^{T} \mathbf{r} + \varphi_0 \right), $$

where $t$ is time, $\omega$ is temporal frequency, $\mathbf{r}$ is position, and $\mathbf{k}$ is the wave vector. The wave vector is a unit vector in the direction of propagation scaled by the wavenumber, $k = \omega / c_0 = 2\pi / \lambda$, it will often look something like

$$ \mathbf{k} = k \left[ \begin{array}{c} \cos(\phi) \cos(\theta) \\ \cos(\phi) \sin(\theta) \\ \sin(\phi) \end{array} \right], $$

where $\theta$ would usually be the azimuth angle and $\phi$ the elevation.

If you look at your equation, it is of the same form except that it is only using 2 spatial dimensions, $x$ and $y$. (So it's a plane wave with its propagation confined to the $x-y$ plane.) Thus, what you have written as "w*(x,y)" is $\mathbf{k}^{T} \mathbf{r}$ in the above; it is the dot product between the wave vector and the position vector.

Also, your equation does not return a vector but rather a scalar; it takes a 2D location and an instant in time and returns the scalar value of the propagating wave at that point at that particular time ($\mathbb{R}^{3} \rightarrow \mathbb{C}$).

  • Thanks a lot. Very helpful. Now i am curious as to how to apply this to return a height value for each of my vertices? SO yPos would be = to K? –  Feb 03 '14 at 08:27
  • Is $Y(x,y,t)$ meant to be the height at location $(x,y)$ at time $t$? – AnonSubmitter85 Feb 03 '14 at 08:28
  • Note what your equation does. It takes location as one of its inputs, with the other input being time; you have to tell it both to get a value as a plane wave oscillates in both dimensions. This image might help you picture it. I hope that helps, as I don't know what 'yPos' or 'K' means in this context, nor what you exactly mean by a vertex. – AnonSubmitter85 Feb 03 '14 at 08:33
  • This thread better explains my issue: http://gamedev.stackexchange.com/questions/69824/3d-water-simulation-formula-questions –  Feb 04 '14 at 05:47
  • @TastyLemons I don't understand why you are changing the y position of the vertices. Shouldn't the vertex be at a fixed location in the $x-y$ plane with its height determined by the wave equation? It looks like you have a mesh of points in the $x-y$ plane, so that at time $t$ vertex $i$ is at $(x_i,y_i,z_i)$, where $z_i = Y(x_i,y_i,t)$. As the value of $t$ changes, so does $z_i$, which should give you the effect of a propagating wave. – AnonSubmitter85 Feb 04 '14 at 09:07