3x3 3d 旋转矩阵逻辑问题 - 串联无法按预期工作
简而言之,我需要一个简单而快速的算法来从 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果
M0 = C0 * X0
(规则 8),则X0 = Ct * M0
(您的公式X0 = M0 * Ct
是错误的)。如果此
X0
也不满足其他规则,则您的规则集没有解决方案。If
M0 = C0 * X0
(rule 8), thenX0 = Ct * M0
(your formulaX0 = M0 * Ct
is wrong).If this
X0
does not also satisfy the other rules, then your set of rules doesn't have a solution.您需要知道两件事:
我们知道:
这些都是轮换。因此:
将 (8) 预乘以 Ct:
因此我们得到 X0。
You need to know two things:
We know:
and these are rotations. So:
Pre-multiply (8) by Ct:
And hence we have X0.