成角度的行波
我已经尝试了很长时间来解决这个问题,但似乎没有任何效果。
我基本上是想以任意速度产生行波。
一般来说,我一直在尝试使用涉及平面波动方程的东西,当你有一个矢量速度
和一个点位置
时,它会像这样:
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);
在一维中测试这当然有效。其中
float x = speed
和
float y =amplitude * cos((waveNumber *position.x) - (omega * time))
这对我来说很有意义。但对于二维,我陷入了 psi 的困境。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
2D 平面波动方程具有使用坐标向量代替 1D 情况的标量坐标的解析解。
解由此页面上的方程给出,其中下划线表示向量。
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.