四元数表示向量V1到V2的旋转
来源:互联网 发布:mac安装axure出错 编辑:程序博客网 时间:2024/06/06 01:34
版权声明:本文为博主原创文章,未经博主允许不得转载。
博主:shenshikexmu
联系方式:shenshikexmu@163.com
本文的算法来源于stackoverflow 的回答finding quaternion representing the rotation from one vector to another
问题
如下图,三维空间中的向量
当知道单位向量
也就是:
在
设:
那么有如下关系:
算法1
思路:寻找
使
于是
function [q] = qUtoV(v1, v2) %Finding quaternion representing the rotation from one vector to anothernv1 = v1/norm(v1);nv2 = v2/norm(v2);if norm(nv1+nv2)==0 q = [0, [1,0,0]];else half = (nv1 + nv2)/norm(nv1 + nv2); q = [nv1*half',cross(nv1, half)];endend
算法2
这个算法需要一些数学推导了,呵呵,看了stackoverflow页面,有了四元数的思想,算法1还是很好理解,这个算法2也是想把之前imu的工作结束掉,花了些时间推导了一下。
于是
向量
function [q] = qUtoV2(v1, v2) %Finding quaternion representing the rotation from one vector to anothernv1 = v1/norm(v1);nv2 = v2/norm(v2);if norm(nv1+nv2)==0 q = [0, [1,0,0]];else q = [norm(nv1)*norm(nv2)+nv1*nv2',cross(nv1, nv2)]; q=q/norm(q);endend
- 四元数表示向量V1到V2的旋转
- 向量 向量的表示
- Hadoop V1到Hadoop V2的主要变化
- 利用四元数来表示坐标系的旋转在运动时旋转向量的微分公式推导
- 词的向量表示
- 词的向量表示
- 词的向量表示
- 向量的旋转
- 向量的旋转
- 神奇的向量旋转
- 向量的旋转
- 向量的旋转证明
- [转]向量的旋转
- 向量的旋转
- 四元数旋转向量
- 旋转的表示方法
- cocos2d 从v1更新到v2安装文件、工程模板时遇到 Permission Denied 的解决方案
- cocos2d 从v1.x升级到v2.x需要注意的几个地方
- 指针数组
- Effective Java系列读后感(二)-对于所有对象都通用的方法
- 关于生存
- Windows Service服务程序的原理及实现(1)实现对服务的控制和管理
- 边城小猿——某小城程序员15年的工作经历(已转行)
- 四元数表示向量V1到V2的旋转
- 学习理论、模型选择、特征选择——斯坦福CS229机器学习个人总结(四)
- [掌盟+]RecycleView实现"英雄资料"页和"发现"页
- 《产品经理方法论》
- STM32笔记0428/建立模板
- 关于Android源码的获取
- 4.29面试总结
- LeetCode 130. Surrounded Regions (并查集)
- POJ 3159 Candies(差分规划+SPFA)