旋转矩阵到带角度的向量

Posted

技术标签:

【中文标题】旋转矩阵到带角度的向量【英文标题】:Rotation matrix to vector with angle 【发布时间】:2013-06-14 08:11:30 【问题描述】:

在我的代码中使用HelixToolkit 我有一个旋转矩阵(3x3),例如:

UX  VX  WX

UY  VY  WY

UZ  VZ  WZ

我想旋转GeometryModel3D。我找到了RotateTransform3D,我需要一个带角度的 Vector3D:

// Create and apply a transformation that rotates the object.
RotateTransform3D myRotateTransform3D = new RotateTransform3D();
 AxisAngleRotation3D myAxisAngleRotation3d = new AxisAngleRotation3D();
**myAxisAngleRotation3d.Axis = new Vector3D(0, 3, 0);
myAxisAngleRotation3d.Angle = 40;**
myRotateTransform3D.Rotation = myAxisAngleRotation3d;
// Add the rotation transform to a Transform3DGroup
Transform3DGroup myTransform3DGroup = new Transform3DGroup();
myTransform3DGroup.Children.Add(myRotateTransform3D);
//ajoute the transformation to the model
model3D.Transform = myTransform3DGroup;

如何从我的旋转矩阵计算矢量和角度?

【问题讨论】:

【参考方案1】:

如果您已经计算了矩阵,则可以将其与一般的MatrixTransform3D 一起使用。只需将矩阵的值设置为计算值即可。

但是,如果您真的想计算旋转轴和角度,则必须求解线性方程组。看看the Wikipedia entry。但是那样的话,你会计算得比你实际需要的多。

【讨论】:

MatrixTransform3D 正是我所需要的!

以上是关于旋转矩阵到带角度的向量的主要内容,如果未能解决你的问题,请参考以下文章

给定 3D 旋转矩阵和 3D 方向向量求角度差

三维坐标下的旋转

变换矩阵

矩阵变换:沿任意轴旋转及其推导

旋转矩阵的三维空间

旋转矩阵和变换矩阵的概念和区别