3x3 3d 旋转矩阵逻辑问题 - 串联无法按预期工作

发布于 2024-10-30 00:39:23 字数 966 浏览 2 评论 0原文

简而言之,我需要一个简单而快速的算法来从 C * X = M 中找到解 X,其中所有变量都是矩阵。下面有更多解释。

我正在尝试计算一个特定的矩阵,但它并没有真正按预期工作:

Vz - negative Z-axis vector (or any other)
Vg - current gravity vector
Vc - zero reference vector (for gravity calibration)

M0 - current rotation matrix
C0 - reference rotation matrix
X0 - unknown rotation matrix to find
*t - transposed versions of above matrices

Upong runtime only Vg, M and C are known.

Rules:

1) Vz == Vg * M0
2) Vg == Vz * Mt
3) Vz == Vc * C0
4) Vc == Vz * Ct
5) Vz == Vx * X0
6) Vx == Vz * Xt
7) Vx == Vg * C0
8) M0 == C0 * X0 (wrong!!! see update notes below)
...
?) X0 = ?

我尝试使用这样的公式:

X0 = M0 * Ct

但生成的矩阵并不满足预期的规则(5)和(6)。

有什么想法这里出了什么问题吗?

更新:

我尝试的公式 (X0 = M0 * Ct) 是正确的。 这个问题是不正确的,因为 (8) 实际上是 M0 = X0 * C0。

我认为它不起作用的问题是因为我尝试计算 Vx = Vg * C0 - 但实际上 Vx = Vg * C0 和 Vg = Vx * Ct 都不正确。

因此,我将转向下一个任务 - 最好将其描述为一个新问题:-)

In basic words I need a simple and fast algorithm to find the solution X from C * X = M where all variable are matrices. More explanations below.

I'm trying to compute one specific matrix but it doesn't really work as expected:

Vz - negative Z-axis vector (or any other)
Vg - current gravity vector
Vc - zero reference vector (for gravity calibration)

M0 - current rotation matrix
C0 - reference rotation matrix
X0 - unknown rotation matrix to find
*t - transposed versions of above matrices

Upong runtime only Vg, M and C are known.

Rules:

1) Vz == Vg * M0
2) Vg == Vz * Mt
3) Vz == Vc * C0
4) Vc == Vz * Ct
5) Vz == Vx * X0
6) Vx == Vz * Xt
7) Vx == Vg * C0
8) M0 == C0 * X0 (wrong!!! see update notes below)
...
?) X0 = ?

I tried to use formula like that:

X0 = M0 * Ct

But the resulting matrix does not satifsy the rules (5) and (6) as expected.

Any ideas what's wrong here?

UPDATE:

The formula I tried (X0 = M0 * Ct) is correct.
The question was incorrect as (8) is actually M0 = X0 * C0.

The problem why I thought it doesn't work was because I tried to compute Vx = Vg * C0 - but actually neither Vx = Vg * C0 nor Vg = Vx * Ct are correct.

Thus I'm moving to the next task - that is better to describe as a new question :-)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

才能让你更想念 2024-11-06 00:39:23

如果 M0 = C0 * X0(规则 8),则 X0 = Ct * M0(您的公式 X0 = M0 * Ct 是错误的)。

如果此 X0 也不满足其他规则,则您的规则集没有解决方案。

If M0 = C0 * X0 (rule 8), then X0 = Ct * M0 (your formula X0 = M0 * Ct is wrong).

If this X0 does not also satisfy the other rules, then your set of rules doesn't have a solution.

哀由 2024-11-06 00:39:23

您需要知道两件事:

  • 对于旋转,转置是逆的
  • 矩阵乘法不能交换。

我们知道:

  M0 = C0 * X0  (8)

这些都是轮换。因此:

inverse (C0) = Ct

将 (8) 预乘以 Ct:

Ct * M0 = Ct * C0 * X0
        = X0  

因此我们得到 X0。

You need to know two things:

  • For rotations, transposes are inverses
  • Matrix multiplication does not commute.

We know:

  M0 = C0 * X0  (8)

and these are rotations. So:

inverse (C0) = Ct

Pre-multiply (8) by Ct:

Ct * M0 = Ct * C0 * X0
        = X0  

And hence we have X0.

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