Question

I've been trying for the longest time to figure this out but nothing seems to work.

I'm bascially trying to make a travelling wave with an arbitrary velocity.

In general what I've been trying to use is something involving the plane wave equation which goes like this when you have a Vector velocity and a Point position:

float pi2 = 2 * PI;

// For our purposes lambda is the speed
float lambda = velocity.length();

// Therefore frequency is 1
float frequency = 1.0F;

// Making angular frequency equal to 2 * PI
float omega = pi2;

// Lambda is the wavelength and pi2 / lambda is the wave number
Vector waveVector = velocity.norm().multiply(pi2 / lambda);

// Theta is the angle from the origin to the new position at time
float theta = waveVector.dot(position.toVector()) - (omega * time);

// Here's where I'm stuck. Psi is equal to the current disturbance of the wave.
// Where do I go from here to get the new coordinates?
float psi = amplitude * cos(theta);

Tested in 1 dimension and this works of course. Where

float x = speed

and

float y = amplitude * cos((waveNumber * position.x) - (omega * time))

That much makes sense to me. But for 2 dimensions I get stuck at psi.

Was it helpful?

Solution

The 2D plane wave equation has an analytical solution using the coordinate vector in place of the scalar coordinate for the 1D case.

The solution is given by an equation on this page, where the underlines indicate a vector.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top