四元数与轴 +角度

发布于 2025-01-08 11:54:27 字数 265 浏览 3 评论 0原文

我一直在试图找出两者之间的区别,但没有运气减去这个

主要区别 这两种表示形式是四元数的旋转轴被缩放 通过旋转半角的正弦,而不是将角度存储在 向量的第四个分量,我们存储半角的余弦。

我不知道什么

旋转半角的正弦

半角余弦

什么意思?

I have been trying to find the difference between the 2 but to no luck minus this

The primary diff erence between
the two representations is that a quaternion’s axis of rotation is scaled
by the sine of the half angle of rotation, and instead of storing the angle in the
fourth component of the vector, we store the cosine of the half angle.

I have no idea what

sine of the half angle of rotation

or

cosine of the half angle

means?

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

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

发布评论

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

评论(2

羁绊已千年 2025-01-15 11:54:27

Quaternios 和 Axis-angle 都是 3D 旋转/方向的表示,并且都有优点和缺点。

Axis-angle:表示按角度a和旋转轴n进行旋转。例如,绕 Y 轴旋转 180 度将表示为 a = 180, n= {0,1,0}。这种表示非常直观,但为了实际应用旋转,需要另一种表示,例如四元数或旋转矩阵。

四元数:表示4D向量的旋转。需要更多的数学知识并且不太直观,但它是一种更强大的表示形式。四元数很容易插值(混合),并且很容易将它们应用到 3D 点上。这些公式可以很容易地在网上找到。假设绕标准化轴 n 旋转 a 弧度,四元数 4D 向量将为 {cos a/2,(sin a/2) n_x,(sin a/2) n_y,(sin a/2) n_z}。这就是半角的正弦和余弦的来源。

Quaternios and Axis-angle are both representations of 3D rotations/orientations and both have pro's and cons.

Axis-angle: represents the rotation by its angle a and the rotation axis n. For example, a rotation of 180 degrees around the Y-Axis would be represented as a = 180, n= {0,1,0}. The representation is very intuitive, but for actually applying the rotation, another representation is required, such as a quaternion or rotation matrix.

Quaternion: represents a rotation by a 4D vector. Requires more math and is less intuitive, but is a much more powerful representation. Quaternions are easily interpolated (blending) and it is easy to apply them on 3D point. These formula's can easily be found on the web. Given a rotation of a radians about a normalized axis n, the quaternion 4D vector will be {cos a/2, (sin a/2) n_x, (sin a/2) n_y, (sin a/2) n_z}. That's where the sine and cosine of the half angle come from.

清风挽心 2025-01-15 11:54:27

这意味着,例如,如果您想绕 Z 轴 (0,0,1) 旋转 180 度,那么四元数的实部将为 cos(180deg/2)=0,其虚部将为 sin(180deg/2)*(0,0,1)=(0,0,1)。这就是q=0+0i+0j+1k。 90 度旋转将为您 q=cos(90deg/2)+sin(90deg/2)*(0i+0j+1k)=sqrt(2)/2+0i+0j+sqrt(2)/ 2*k,等等。

OTOH,如果您问什么是正弦和余弦,请检查您的语言是否提供 sin()cos() 函数(尽管它们的参数可能以弧度为单位) ),并查看 http://en.wikipedia.org/wiki/Sine

It means that if you, for example, want to make a 180deg rotation around the Z axis (0,0,1), then the quaternion's real part will be cos(180deg/2)=0, and its imaginary part will be sin(180deg/2)*(0,0,1)=(0,0,1). That's q=0+0i+0j+1k. 90-degree rotation will give you q=cos(90deg/2)+sin(90deg/2)*(0i+0j+1k)=sqrt(2)/2+0i+0j+sqrt(2)/2*k, and so on.

OTOH, if you're asking what sine and cosine are, check if your languange provides sin() and cos() functions (their arguments will probably be in radians, though), and check out http://en.wikipedia.org/wiki/Sine.

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