成角度的行波

发布于 2025-01-04 08:03:57 字数 1010 浏览 0 评论 0原文

我已经尝试了很长时间来解决这个问题,但似乎没有任何效果。

我基本上是想以任意速度产生行波。

一般来说,我一直在尝试使用涉及平面波动方程的东西,当你有一个矢量速度和一个点位置时,它会像这样:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤城病女 2025-01-11 08:03:57

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文