matlab优化工具箱机器人工具箱Quaternion(四元数)问题

&>&matlab机器人工具箱10.2
matlab机器人工具箱10.2
上传大小:12.24MB
matlab机器人工具箱10.2,全新的机器人工具箱,内容更全,适合matlab的机器人仿真!
综合评分:0
{%username%}回复{%com_username%}{%time%}\
/*点击出现回复框*/
$(".respond_btn").on("click", function (e) {
$(this).parents(".rightLi").children(".respond_box").show();
e.stopPropagation();
$(".cancel_res").on("click", function (e) {
$(this).parents(".res_b").siblings(".res_area").val("");
$(this).parents(".respond_box").hide();
e.stopPropagation();
/*删除评论*/
$(".del_comment_c").on("click", function (e) {
var id = $(e.target).attr("id");
$.getJSON('/index.php/comment/do_invalid/' + id,
function (data) {
if (data.succ == 1) {
$(e.target).parents(".conLi").remove();
alert(data.msg);
$(".res_btn").click(function (e) {
var parentWrap = $(this).parents(".respond_box"),
q = parentWrap.find(".form1").serializeArray(),
resStr = $.trim(parentWrap.find(".res_area_r").val());
console.log(q);
//var res_area_r = $.trim($(".res_area_r").val());
if (resStr == '') {
$(".res_text").css({color: "red"});
$.post("/index.php/comment/do_comment_reply/", q,
function (data) {
if (data.succ == 1) {
var $target,
evt = e || window.
$target = $(evt.target || evt.srcElement);
var $dd = $target.parents('dd');
var $wrapReply = $dd.find('.respond_box');
console.log($wrapReply);
//var mess = $(".res_area_r").val();
var mess = resS
var str = str.replace(/{%header%}/g, data.header)
.replace(/{%href%}/g, 'http://' + window.location.host + '/user/' + data.username)
.replace(/{%username%}/g, data.username)
.replace(/{%com_username%}/g, data.com_username)
.replace(/{%time%}/g, data.time)
.replace(/{%id%}/g, data.id)
.replace(/{%mess%}/g, mess);
$dd.after(str);
$(".respond_box").hide();
$(".res_area_r").val("");
$(".res_area").val("");
$wrapReply.hide();
alert(data.msg);
}, "json");
/*删除回复*/
$(".rightLi").on("click", '.del_comment_r', function (e) {
var id = $(e.target).attr("id");
$.getJSON('/index.php/comment/do_comment_del/' + id,
function (data) {
if (data.succ == 1) {
$(e.target).parent().parent().parent().parent().parent().remove();
$(e.target).parents('.res_list').remove()
alert(data.msg);
//填充回复
function KeyP(v) {
var parentWrap = $(v).parents(".respond_box");
parentWrap.find(".res_area_r").val($.trim(parentWrap.find(".res_area").val()));
评论共有0条
综合评分:
积分/C币:3
VIP会员动态
CSDN下载频道资源及相关规则调整公告V11.10
下载频道用户反馈专区
下载频道积分规则调整V1710.18
spring mvc+mybatis+mysql+maven+bootstrap 整合实现增删查改简单实例.zip
资源所需积分/C币
当前拥有积分
当前拥有C币
输入下载码
为了良好体验,不建议使用迅雷下载
matlab机器人工具箱10.2
会员到期时间:
剩余下载个数:
剩余积分:0
为了良好体验,不建议使用迅雷下载
积分不足!
资源所需积分/C币
当前拥有积分
您可以选择
程序员的必选
绿色安全资源
资源所需积分/C币
当前拥有积分
当前拥有C币
为了良好体验,不建议使用迅雷下载
资源所需积分/C币
当前拥有积分
当前拥有C币
为了良好体验,不建议使用迅雷下载
资源所需积分/C币
当前拥有积分
当前拥有C币
您的积分不足,将扣除 10 C币
为了良好体验,不建议使用迅雷下载
无法举报自己的资源
你当前的下载分为234。
你还不是VIP会员
开通VIP会员权限,免积分下载
你下载资源过于频繁,请输入验证码
您因违反CSDN下载频道规则而被锁定帐户,如有疑问,请联络:!
若举报审核通过,可返还被扣除的积分
被举报人:
请选择类型
资源无法下载 ( 404页面、下载失败、资源本身问题)
资源无法使用 (文件损坏、内容缺失、题文不符)
侵犯版权资源 (侵犯公司或个人版权)
虚假资源 (恶意欺诈、刷分资源)
含色情、危害国家安全内容
含广告、木马病毒资源
*投诉人姓名:
*投诉人联系方式:
*版权证明:
*详细原因:
matlab机器人工具箱10.2[转载][学习笔记]Matlab&Robotic&Toolbox工具箱学习笔记(一
Robotic Toolbox工具箱学习笔记(一)
软件:matlab2013a
工具箱:Matlab Robotic Toolbox
Matlab Robotic
Toolbox工具箱学习笔记根据Robot Toolbox demonstrations目录,将分三大部分阐述:
1、General(Rotations,Transformations,Trajectory)
2、Arm(Robot,Animation,Forwarw
kinematics,Inverse kinematics,Jacobians,Inverse dynamics,Forward
dynamics,Symbolic,Code generation)
3、Mobile(Driving to a
pose,Quadrotor,Braitenberg,Bug,D*,PRM,SLAM,Particle
General/Rotations
%绕x轴旋转pi/2得到的旋转矩阵
(1)r = rotx(pi/2);
%matlab默认的角度单位为弧度,这里可以用度数作为单位
(2)R = rotx(30, 'deg') * roty(50, 'deg') * rotz(10,
%求出R等效的任意旋转变换的旋转轴矢量vec和转角theta
(3)[theta,vec] = tr2angvec(R);
%旋转矩阵用欧拉角表示,R =
rotz(a)*roty(b)*rotz(c)
(4)eul = tr2eul(R);
%旋转矩阵用roll-pitch-yaw角表示,
R = rotx(r)*roty(p)*rotz(y)
(5)rpy = tr2rpy(R);
%旋转矩阵用四元数表示
Quaternion(R);
%将四元数转化为旋转矩阵
&%界面,可以是“rpy”,“eluer”角度单位为度。
(8)tripleangle('rpy');
General/Transformations
%沿x轴平移0.5,绕y轴旋转pi/2,绕z轴旋转-pi/2
transl(0.5, 0.0, 0.0) * troty(pi/2) * trotz(-pi/2)
%将齐次变换矩阵转化为欧拉角
(2)tr2eul(t)
%将齐次变换矩阵转化为roll、pitch、yaw角
(3) tr2rpy(t)
General/Trajectory
p0 = -1;% 定义初始点及终点位置
p = tpoly(p0, p1, 50);% 取步长为50
figure(1);
plot(p);%绘图,可以看到在初始点及终点的一、二阶导均为零
[p,pd,pdd] = tpoly(p0, p1, 50);%得到位置、速度、加速度
%p为五阶多项式,速度、加速度均在一定范围内
figure(2);
subplot(3,1,1); plot(p); xlabel('Time'); ylabel('p');
subplot(3,1,2); plot(pd); xlabel('Time'); ylabel('pd');
subplot(3,1,3); plot(pdd); xlabel('Time');
ylabel('pdd');
%另外一种方法:
[p,pd,pdd] = lspb(p0, p1, 50);
figure(3);
subplot(3,1,1); plot(p); xlabel('Time'); ylabel('p');
subplot(3,1,2); plot(pd); xlabel('Time'); ylabel('pd');%
可以看到速度是呈梯形
subplot(3,1,3); plot(pdd); xlabel('Time');
ylabel('pdd');
%三维的情况:
p = mtraj(@tpoly, [0 1 2], [2 1 0], 50);
figure(4);
%对于齐次变换矩阵的情况
T0 = transl(0.4, 0.2, 0) * trotx(pi);% 定义初始点和目标点的位姿
T1 = transl(-0.4, -0.2, 0.3) * troty(pi/2) * trotz(-pi/2);
T = ctraj(T0, T1, 50);
first=T(:,:,1);%初始位姿矩阵
tenth=T(:,:,10);%第十个位姿矩阵
figure(5);
tranimate(T);%动画演示坐标系自初始点运动到目标点的过程
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。关于Rotation和Quaternion的一些问题【墨名夜星吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0可签7级以上的吧50个
本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:4,973贴子:
关于Rotation和Quaternion的一些问题
当我们使用unity的时候,面对一个物体,一个不可避免的问题就是:控制物体的旋转。unity的Transform组件的第二个属性Rotation为我们提供控制物体旋转的功能。在一个物体的Inspector面板中,我们可以看到三个信息(X,Y,Z)。但是unity同时还具有Quaternion(四元数)的功能,所以这里就有必要介绍一下——欧拉角与四元数(能力有限,只是简单的为大家介绍一下),而unity采用这两种方式来表示旋转或者方向都是为了便于储存。欧拉角(Euler angles):简单来说就是一种定义物体方向的方法如图所示,为我们展示了欧拉角,包括(α,β,γ)。另外还有一条特殊的绿色线N。对于上图作几点说明:蓝色坐标系xyz(小写)表示原始或初始坐标系位置(方向);红色坐标系(XYZ)表示旋转后的坐标方向。绿色的线(line of nodes)是xy和XY坐标平面的交线,那么这条线也就同时正交垂直于zZ平面。α:x与N的夹角;β:z与Z的夹角 γ:N与X的夹角四元数(Quaternion)很抱歉,对于四元数的理解,现在我也不是很清楚,只是简单的对unity的Quaternion的几个函数方法进行了简单了解。下面是百度百科的解释,希望对你有所帮助:四元数是简单的超复数。 复数是由实数加上虚数单位 i 组成,其中i^2 = -1。 相似地,四元数都是由实数加上三个虚数单位 i、j、k 组成,而且它们有如下的关系: i^2 = j^2 = k^2 = -1, i^0 = j^0 = k^0 = 1 , 每个四元数都是 1、i、j 和 k 的线性组合,即是四元数一般可表示为a + bk+ cj + di,其中a、b、c 、d是实数。(百度百科)关于四元数和欧拉角之间的互相转换,这里就不再赘述,因为看不懂啊,等体会理解后,在为大家讲解这里有一篇关于Quaternion下函数方法详细介绍:说了这么多,其实我想为大家解释的是:下面这样一个问题:unity什么时候用欧拉角,什么时候使用四元数。在我们的接触中,unity大部分是接受四元数的输入和输出的。比如说,我们想输出Transform组件的Rotation信息。直接这样写:transform.rotation是不行的,你会发现显示的是一组[-1,1]的数值。而需要调用localEulerAngles方法,才会获得我们所熟知的角度表示。总结来说:其实Transform.rotation是存储的四元数信息,而真正的欧拉角需要调用方法才会获得,即Euler Angles存储的Vector3类型的变量。我们如何在unity中将一个Vector3类型的欧拉角传给四元数形式的rotation呢?我们不需要复杂的数学运行,需要调用Quaternion下面的方法函数即可。transform.rotation=Quaternion.Euler(x,y,z)或者是transform.EulerAngles=new Vector(0.0,0.0,0.0)最后,介绍一下lerp与slerp的区别lerp()函数,我们都很了解,进行插值运算,对于物体平移,使用lerp函数,十分方便。这里就不过多说明了,详细请看unity 圣典。然而对于物体旋转方向的插值,效果就不那么理想了。其实unity还为我们提供了另一种插值函数---Slerp。Quaternion.lerp()。关于这个函数在圣典中的说明很短,只解释是球形插值。让人费解。关于这个问题我的理解是,如果想要对物体的旋转进行插值,我们应该选择slerp函数,这个函数利用四元数,对旋转的角度进行插值,(至于更深层次的机制,我也不甚了解,希望大家留言补充)从而能够达到较为理想的效果。另外,还有Quaternion.lerp()函数,这个说是效果也不如slerp。大家可以自行尝试。下面是关于slerp函数的代码解释static function Slerp (from : Quaternion, to : Quaternion,t : float) : Quaternion 注意form和to都是Quaternion四元数类型,而不是vector3类型。Quaternion.Slerp (Quaternion.Euler(rotation_begin),Quaternion.Euler(rotation_end),t); Euler()方法是为了将Vector3类型转换成四元数类型。这是slerp函数的参数要求
……我只是随便点进来看看……你是学什么的……
贴吧热议榜
使用签名档&&
保存至快速回贴This page describes quaternions in mathematics. For other uses of this word, see .
Graphical representation of quaternion units product as 90°-rotation in 4D-space, ij = k, ji = −k, ij = −ji
Quaternions, in , are a
extension of . They were first described by the
and applied to
in three-dimensional space. They find uses in both theoretical and
applied mathematics, in particular for calculations involving , such as in 3D , although they have been superseded in many applications by
In modern language, quaternions form a 4-dimensional
over the . The algebra of quaternions is often denoted by H (for Hamilton), or in
(Unicode H). It can also be given by the
classifications Cl0,2(R) = Cl03,0(R). The algebra H holds a special place in analysis since, according to the , it is one of only three finite-dimensional
containing the
Main article:
Quaternion plaque on Brougham (Broom) Bridge, , which says:
Here as he walked by
on the 16th of October 1843
Sir William Rowan Hamilton
in a flash of genius discovered
the fundamental formula for quaternion multiplication
i² = j² = k² = i j k = −1
& cut it on a stone of this bridge.
Quaternions were introduced by
mathematician
in 1843. Hamilton knew that the
could be viewed as
in a , and he was looking for a way to do the same for points in .
Points in space can be represented by their coordinates, which are
triples of numbers, and for many years Hamilton had known how to add
and multiply triples of numbers. But he had been stuck on the problem
of division: He did not know how to take the quotient of two points in
On October 16, 1843, Hamilton and his wife took a walk along the Royal Canal in . While they walked across Brougham Bridge (now ), a solution suddenly occurred to him. He could not divide triples, but he could divide quadruples.
By using three of the numbers in the quadruple as the points of a
coordinate in space, Hamilton could represent points in space by his
new system of numbers. He then carved the basic rules for
multiplication into the bridge:
i2 = j2 = k2 = ijk = − 1
Hamilton called a quadruple with these rules of multiplication a quaternion,
and he devoted the rest of his life to studying and teaching them. He
founded a school of "quaternionists" and popularized them in several
books. The last and longest, Elements of Quaternions, had 800 pages and was published shortly after his death.
After Hamilton's death, his pupil
continued promoting quaternions. At this time, quaternions were a
mandatory examination topic in Dublin, and in some American
universities they were the only advanced mathematics topic taught.
Topics in physics and geometry that would now be described using
vectors, such as
in space and , were described entirely in terms of quaternions. There was even a professional research association, the , exclusively devoted to the study of quaternions.
From the mid 1880s, quaternions began to be displaced by , which had been developed by
Vector analysis was conceptually simpler and notationally cleaner, and
eventually quaternions were relegated to a minor role in mathematics
and physics.
However, quaternions have had a revival in the late 20th century,
primarily due to their utility in describing spatial rotations.
Representations of rotations by quaternions are more compact and faster
to compute than representations by matrices. For this reason,
quaternions are used in , , , , , , and .
For example, it is common for spacecraft attitude-control systems to be
commanded in terms of quaternions. Quaternions have received another
boost from
because of their relation to .
Reading works written before 1900 on the subject of
is difficult for modern readers because they frequently use Hamilton's
notation and terminology, which differs from the notation and
terminology used today.
Since 1989, the Department of Mathematics of the
has organized a pilgrimage, where scientists (including physicists
in 2002 and
in 2005 and mathematician
in 2003) take a walk from
to the Royal Canal bridge where, unfortunately, no trace of Hamilton's carving remains.
As a set, the quaternions H are equal to R4, a four-dimensional
over the . H has three operations: Addition, scalar multiplication, and quaternion multiplication. The sum of two elements of H is defined to be their sum as elements of R4. Similarly the product of an element of H by a real number is defined to be the same as the product in R4. To define multiplication in H requires a choice of
for R4. The elements of this basis are customarily denoted as 1, i, j, and k. Every element of H can be uniquely written as a
of these basis elements, that is, as a1 + bi + cj + dk, where a, b, c, and d are . The basis element 1 will be the
of H, meaning that multiplication by 1 does nothing, and for this reason, elements of H are usually written a + bi + cj + dk,
suppressing the basis element 1. Given this basis, quaternion
multiplication is defined by first defining the products of basis
elements and then defining all other products using the distributive
The equations
i2 = j2 = k2 = ijk = − 1,
where i, j, and k are imaginary numbers, determine all the possible products of i, j, and k. For example, since
− 1 = ijk,
right-multiplying both sides by k gives
All the other possible products can be determined by similar methods, and this gives the following table:
For two elements a1 + b1i + c1j + d1k and a2 + b2i + c2j + d2k, their Hamilton product (a1 + b1i + c1j + d1k)(a2 + b2i + c2j + d2k) is determined by the products of the basis elements and the .
The distributive law makes it possible to expand the product so that it
is a sum of products of basis elements. This gives the following
expression:
a1a2 + a1b2i + a1c2j + a1d2k + b1a2i + b1b2i2 + b1c2ij + b1d2ik + c1a1j + c1b2ji + c1c2j2 + c1d2jk + d1a1k + d1b2ki + d1c2kj + d1d2k2.
Now the basis elements can be multiplied using the rules given above to get:
(a1a2 − b1b2 − c1c2 − d1d2) + (a1b2 + b1a2 + c1d2 − d1c2)i + (a1c2 − b1d2 + c1a2 + d1b2)j + (a1d2 + b1c2 − c1b2 + d1a2)k.
Using the basis 1, i, j, k of H makes it possible to write H as a set of :
Then the basis elements are:
1 = (1,0,0,0),i = (0,1,0,0),j = (0,0,1,0),k = (0,0,0,1),
and the formulas for addition and multiplication are:
(a1,b1,c1,d1) + (a2,b2,c2,d2) = (a1 + a2,b1 + b2,c1 + c2,d1 + d2).(a1,b1,c1,d1)(a2,b2,c2,d2) = (a1a2 − b1b2 − c1c2 − d1d2,a1b2 + b1a2 + c1d2 − d1c2,a1c2 − b1d2 + c1a2 + d1b2,a1d2 + b1c2 − c1b2 + d1a2).
A number of the form a + 0i + 0j + 0k, where a is a real number, is called real, and a number of the form 0 + bi + cj + dk, where b, c, and d are real numbers (possibly all zero), is called pure imaginary. If a + bi + cj + dk is any quaternion, then a is called its scalar part and bi + cj + dk is called its vector part.
The scalar part of a quaternion is always real, and the vector part is
always pure imaginary. Even though every quaternion is a vector in a
four-dimensional vector space, it is common to define a vector to mean a pure imaginary quaternion. With this convention, a vector is the same as an element of the vector space R3. This identification leads to many applications.
Hamilton called pure imaginary quaternions right quaternions and real numbers (considered as quaternions with zero vector part) scalar quaternions.
Unlike multiplication of real or complex numbers, multiplication of quaternions is not : For example, ij = k, while ji = − k. The non-commutativity of multiplication has some unexpected consequences, among them that
equations over the quaternions can have more distinct solutions than the degree of the polynomial. The equation z2 + 1 = 0, for instance, has infinitely many quaternion solutions z = bi + cj + dk with b2 + c2 + d2 = 1,
so that these solutions form a two-dimensional sphere centered on zero
in the three-dimensional pure imaginary subspace of quaternions. This
sphere intersects the complex plane at the two poles i and& − i.
Conjugation of quaternions is analogous to conjugation of complex
numbers and to transposition (also known as reversal) of elements of . To define it, let q = a +bi +cj + dk be a quaternion. The conjugate of q is the quaternion a − bi − cj − dk. It is denoted by q*, , qt, or . Conjugation is an ,
meaning that it is its own inverse, so conjugating an element twice
returns the original element. The conjugate of a product of two
quaternions is the product of the conjugates in the reverse order. That is, if p and q are quaternions, then (pq)* = q*p*, not p*q*.
Conjugation can be used to extract the scalar and vector parts of a quaternion. The scalar part of p is (p + p*)/2, and the vector part of p is (p − p*)/2.
The square root of the product of a quaternion with its conjugate is called its
and is denoted ||q||. (Hamilton called this quantity the tensor of q, but this conflicts with modern usage. See .) It has the formula
This is always a non-negative real number, and it is same as the Euclidean norm on H considered as the vector space R4. Multiplying a quaternion by a real number scales its norm by the absolute value of the number. That is, if α is real, then
This is a special case of the fact that the norm is multiplicative, meaning that
for any two quaternions p and q. Multiplicativity is a consequence of the formula for the conjugate of a product. This norm makes it possible to define the distance d(p, q) between p and q as the norm of their difference:
This makes H into a . Addition and multiplication are continuous in the metric topology.
A unit quaternion is a quaternion of norm one. Dividing a non-zero quaternion q by its norm produces a unit quaternion Uq called the
Using conjugation and the norm makes it possible to define the
of a quaternion. The product of a quaternion with its reciprocal should
equal 1, and the considerations above imply that the product of q and
is 1. So the reciprocal of q is defined to be
This makes it possible to divide two quaternions p and q in two different ways. That is, their quotient can be either pq−1 or q−1p. The notation p/q is ambiguous because it does not specify whether q divides on the left or the right.
The set H of all quaternions is a
4. (In comparison, the real numbers have dimension 1, the complex numbers have dimension 2, and the
have dimension 8.) They are an
over the real numbers. Even though they contain copies of the complex
numbers, they are not an associative algebra over the complex numbers
because multiplying a quaternion by a complex number is not always
commutative.
The norm makes the quaternions into a , and even into a
and a unital . Composition algebras are very rare.
states that there are only four composition algebras over the real numbers: R, C, H, and O. Because it is possible to divide quaternions, they form a . This is a structure similar to a
except for the commutativity of multiplication. Finite dimensional
division algebras over the real numbers are also very rare. The
states that there are exactly three: R, C, and H.
Because the product of any two basis vectors is plus or minus another basis vector, the set {±1, ±i, ±j, ±k} forms a
under multiplication. This group is called the
and is denoted Q8. The real
of Q8 is a ring RQ8 which is also an eight-dimensional vector space over R. It has one basis vector for each element of Q8. The quaternions are the
of RQ8 by the
generated by the elements 1 − (−1), i − (−i), j − (−j), and k − (−k). Here the first term in each of the differences is one of the basis elements 1, i, j, and k, and the second term is one of basis elements −1, −i, −j, and −k, not the additive inverses of 1, i, j, and k.
Because the vector part of a quaternion is a vector in R3, the geometry of R3
is reflected in the algebraic structure of the quaternions. Many
operations on vectors can be defined in terms of quaternions, and this
makes it possible to apply quaternion techniques wherever spatial
vectors arise. For instance, this is true in , , and .
For the remainder of this section, i, j, and k will denote both imaginary basis vectors of H and a basis for R3. Notice that replacing i by −i, j by −j, and k by −k
sends a vector to its additive inverse, so the additive inverse of a
vector is the same as its conjugate as a quaternion. For this reason,
conjugation is sometimes called the spatial inverse.
Choose two imaginary quaternions p = b1i + c1j + d1k and q = b2i + c2j + d2k. Their
This is equal to the scalar parts of p*q, qp*, pq*, and q*p. (Note that the vector parts of these four products are different.) It also has the formulas
of p and q relative to the orientation determined by the ordered basis i, j, and k is
(c1d2 − d1c2)i + (d1b2 − b1d2)j + (b1c2 − c1b2)k.
(Recall that the orientation is necessary to determine the sign.) This is equal to the vector part of the product pq (as quaternions), as well as the vector part of −q*p*. It also has the formula
In general, let p and q be quaternions (possibly non-imaginary), and write
where ps and qs are the scalar parts of p and q and
are the vector parts of q. Then we have the formula
This shows that the non-commutativity of quaternion multiplication
comes from the multiplication of right quaternions. It also shows that
the product of two quaternions is commutative if and only if their
vector parts are collinear.
There are at least two ways of representing quaternions as
in such a way that quaternion addition and multiplication correspond to matrix addition and . One is to use 2×2
matrices, and the other is to use 4×4
matrices. In the terminology of , these are
from H to the
M2(C) and M4(R), respectively.
Using 2×2 complex matrices, the quaternion a + bi + cj + dk can be represented as
This representation has the following properties:
(c = d = 0) correspond to diagonal matrices.
The norm of a quaternion (the square root of a product with its conjugate, as with complex numbers) is the square root of the
of the corresponding matrix.
The conjugate of a quaternion corresponds to the
of the matrix.
Restricted to unit quaternions, this representation provides an
and . The latter group is important see .
Using 4×4 real matrices, that same quaternion can be written as
In this representation, the conjugate of a quaternion corresponds to the
of the matrix. The fourth power of the norm of a quaternion is the
of the corresponding matrix. Complex numbers are block diagonal matrices with two 2×2 blocks.
Main article:
Quaternions can be represented as pairs of complex numbers. From
this perspective, quaternions are the result of applying the
Cayley–Dickson construction to the complex numbers. This is a
generalization of the construction of the complex numbers as pairs of
real numbers.
Let C2 be a two-dimensional vector space over the complex numbers. Choose a basis consisting of two elements 1 and j. A vector in C2 can be written in terms of the basis elements 1 and j as
(a + bi)1 + (c + di)j.
If we define j2&=&−1 and ij&=&−ji, then we can multiply two vectors using the distributive law. Writing k in place of the product ij
leads to the same rules for multiplication as the usual quaternions.
Therefore the above vector of complex numbers corresponds to the
quaternion a + bi + cj + dk. If we write the elements of C2 as ordered pairs and quaternions as quadruples, then the correspondence is
In the complex numbers, there are just two numbers, i and −i, whose square is −1 . In H there are an infinity of square roots of minus one: the quaternions have a square root of −1 for every point on the unit
in 3-space. To see this, let q&=&a + bi + cj + dk be a quaternion, and assume that its square is −1. In terms of a, b, c, and d, this means
a2 − b2 − c2 − d2 = − 1,2ab = 0,2ac = 0,2ad = 0.
To satisfy the last three equations, either a&=&0 or b, c, and d are all 0. The latter is impossible because a is a real number and the first equation would imply that a2&=&−1. Therefore a&=&0 and b2 + c2 + d2
= 1. In other words, a quaternion squares to −1 if and only if it is a
vector (that is, pure imaginary) with norm 1. Such vectors make a
sphere by defnition.
Each square root of −1 creates a distinct copy of the complex numbers inside the quaternions. If q2&=&−1, then the copy is determined by the function
In the language of , this is an
from C to H.
Every non-real quaternion lies in a unique copy of C. Write q as the sum of its scalar part and its vector part:
Decompose the vector part further as the product of its norm and its versor:
(Note that this is not the same as .) The versor of the vector part of q, ,
is a pure imaginary unit quaternion, so its square is −1. Therefore it
determines a copy of the complex numbers by the function
Under this function, q is the image of the complex number . Thus H is the union of complex planes intersecting in a common , where the union is taken over the sphere of square roots of minus one.
The relationship of quaternions to each other within the complex subplanes of H can also be identified and expressed in terms of
. Specifically, since two quaternions p and q commute (p q = q p) only if they lie in the same complex subplane of H, the profile of H as a union of complex planes arises when one seeks to find all
of the quaternion . Ian R. Porteous's book Clifford Algebras and the Classical Groups (Cambridge, 1995) describes the role of the sphere of unit vectors in proposition 8.13 on page 60.
Functions of a complex variable can be extended to functions of a quaternion variable as follows:
Let the complex function be written
where u and v are real-valued functions of two real variables. According to the above profile, any quaternion can be written
Then the extension is given by .
This is called Fueter's construction.
Main articles:
The multiplicative group of non-zero quaternions acts by conjugation on the copy of R³
consisting of quaternions with real part equal to zero. The conjugation
by a unit quaternion (a quaternion of absolute value 1) with real part
cos(t) is a rotation by an angle 2t, the axis of the rotation being the direction of the imaginary part. The advantages of quaternions are:
Non singular representation (compared with
for example)
More compact (and faster) than
Pairs of unit quaternions represent a rotation in
space (see ).
The set of all unit quaternions () forms a
S³ and a
(a ) under multiplication. S³ is the
of the group SO(3,R) of real orthogonal 3×3
1 since two unit quaternions correspond to every rotation under the above correspondence.
For more details on this topic, see .
The image of a subgroup of S³ is a , and conversely, the preimage of a point group is a subgroup of S³. The preimage of a finite point group is called by the same name, with the prefix binary. For instance, the preimage of the
The group S³ is isomorphic to SU(2), the group of complex
2×2 matrices of
1. Let A be the set of quaternions of the form a + bi + cj + dk where a, b, c, and d are either all
with odd numerator and denominator 2. The set A is a
and a . There are 24 unit quaternions in this ring, and they are the vertices of a
Main article:
If F is any
with characteristic different from 2, and a and b are elements of F, one may define a four-dimensional unitary
over F with basis 1, i, j, and ij, where i2 = a, j2 = b and ij = −ji (so ij2 = −ab). These algebras are called quaternion algebras and are isomorphic to the algebra of 2×2
over F or form
over F, depending on the choice of a and b.
The usefulness of quaternions for geometrical computations can be
generalised to other dimensions, by identifying the quaternions as the
even part Cl+3,0(R) of the
Cl3,0(R). This is an associative multivector algebra built up from fundamental basis elements σ1, σ2, σ3 using the product rules
If these fundamental basis elements are taken to represent vectors in 3D space, then it turns out that the reflection of a vector r in a plane perpendicular to a unit vector w can be written:
Now in geometry, two reflections make a rotation, by an angle twice the angle between the two reflection planes, so
corresponds to a rotation of 180° in the plane containing σ1 and σ2
But this is very similar to the corresponding quaternion formula,
In fact, the two are identical, if we make the identification
and it is straightforward to confirm that this preserves the Hamilton relations
In this picture, quaternions correspond not to vectors but to , quantities with magnitude and orientations associated with particular 2D planes rather than 1D directions. The relation to
becomes clearer, too: in 2D, with two vector directions σ1 and σ2, there is only one bivector basis element σ1σ2, so only one imaginary. But in 3D, with three vector directions, there are three bivector basis elements σ1σ2, σ2σ3, σ3σ1, so three imaginaries.
With this recognition, the sequence can be continued. So in the Clifford algebra Cl4,0(R),
there are six bivector basis elements, since with four different basic
vector directions, six different pairs and therefore six different
linearly independent planes can be defined. Rotations in such spaces
using these generalisations of quaternions, called , can be very useful for applications involving .
But it is only in 3D that the number of basis bivectors equals the
number of basis vectors, and each bivector can be identified as a .
Dorst et al identify the following advantages for placing quaternions in this wider setting:
Rotors are natural and non-mysterious in geometric algebra and easily understood as the encoding of a double reflection.
In geometric algebra, a rotor and the objects it acts on live in
the same space. This eliminates the need to change representations and
to encode new data structures and methods (which is required when
augmenting linear algebra with quaternions).
A rotor is universally applicable to any element of the algebra,
not just vectors and other quaternions, but also lines, planes,
circles, spheres, rays, and so on.
In the conformal model of Euclidean geometry, rotors allow the
encoding of rotation, translation and scaling in a single element of
the algebra, universally acting on any element. In particular, this
means that rotors can represent rotations around an arbitary axis,
whereas quaternions are limited to an axis through the origin.
Rotor-encoded transformations make interpolation particularly straightforward.
For further detail about the geometrical uses of Clifford algebras, see .
"I regard it as an inelegance, or imperfection, in quaternions, or
rather in the state to which it has been hitherto unfolded, whenever it
becomes or seems to become necessary to have recourse to x, y, z, etc."
— William Rowan Hamilton (ed. Quoted in a letter from Tait to Cayley.)
"Time is said to have only one dimension, and space to have three
dimensions. […] The mathematical quaternion partakes of both these
in technical language it may be said to be "time plus space",
or "space plus time": and in this sense it has, or at least involves a
reference to, four dimensions. And how the One of Time, of Space the
Three, Might in the Chain of Symbols girdled be." — William Rowan
Hamilton (Quoted in R.P. Graves, "Life of Sir William Rowan Hamilton")
"Quaternions came from Hamilton after his really good work had been
and, though beautifully ingenious, have been an unmixed evil to
those who have touched them in any way, including ." — , 1892.
"Neither matrices nor quaternions and ordinary vectors were
banished from these ten [additional] chapters. For, in spite of the
uncontested power of the modern Tensor Calculus, those older
mathematical languages continue, in my opinion, to offer conspicuous
advantages in the restricted field of special relativity. Moreover, in
science as well as in every-day life, the mastery of more than one
language is also precious, as it broadens our views, is conducive to
criticism with regard to, and guards against hypostasy
[weak-foundation] of, the matter expressed by words or mathematical
symbols." — , preparing the second edition of his
"… quaternions appear to exude an air of
, as a rather unsuccessful
of mathematical ideas. Mathematicians, admittedly, still keep a warm
place in their hearts for the remarkable algebraic properties of
quaternions but, alas, such enthusiasm means little to the
harder-headed physical scientist." — , 1986
This section contains information which may be of unclear or questionable
to the article's subject matter.
Please help
by clarifying or removing superfluous information.
As a linear algebra over the reals, quaternions constitute a real
S on it, sometimes called the structure tensor. This once
tensor converts a
t and vectors a and b to a
S(t,a,b). For each one-form t, S is a twice covariant tensor, which, if symmetric, is an
on H. Since any real vector space can also be considered a , such an inner product is naturally extended to a , and in case of its nondegeneracy, becomes a (pseudo- or proper-)
metric . For quaternions this inner product is indefinite, its
is independent of the one-form t, and the corresponding pseudo-Euclidean metric is
. This metric is automatically extended over the
of nonzero quaternions along its
resulting in a closed
– an important solution of the . These results have some implications for the problem of compatibility between
within the framework of
(Coquaternion)
(1853), "". Royal Irish Academy.
(1873), "An elementary treatise on quaternions". 2d ed., Cambridge, [Eng.]&: The University Press.
Maxwell, James Clerk (1873), "". Clarendon Press, Oxford.
(1886), "". M.A. Sec. R.S.E. , Ninth Edition, 1886, Vol. XX, pp. 160&#. (bzipped
Joly, Charles Jasper (1905), "A manual of quaternions". London, Macmillan and co., New York, The Macmillan company. LCCN
(1906), "Vector analysis and quaternions", 4th ed. 1st thousand. New York, J. Wiley & S [etc., etc.]. LCCN es
Finkelstein, David, Josef M. Jauch, Samuel Schiminovich, and David Speiser (1962), "Foundations of quaternion quantum mechanics". J. Mathematical Phys. 3, pp. 207&#, MathSciNet.
(1964), "Homographies, quaternions, and rotations". Oxford, Clarendon Press (Oxford mathematical monographs). LCCN
Crowe, Michael J. (1967), "A History of Vector Analysis: The Evolution of the Idea of a Vectorial System".
University of Notre Dame Press. Surveys the major and minor vector
systems of the 19th century (Hamilton, Möbius, Bellavitis, Clifford,
Grassmann, Tait, Peirce, Maxwell, MacFarlane, MacAuley, Gibbs,
Heaviside). The competition between quaternions and other systems is a
major theme.
Altmann, Simon L. (1986), "Rotations, quaternions, and double groups". Oxford [Oxfordshire]&: Clarendon Press&; New York&: Oxford University Press. LCCN
Adler, Stephen L. (1995), "Quaternionic quantum mechanics and quantum fields". New York&: Oxford University Press. International series of monographs on physics (Oxford, England) 88. LCCN
(1995), "A Linear Solution of the Four-Dimensionality Problem", Europhysics Letters, 32 (8) 621&#, DOI:
Ward, J. P. (1997), "Quaternions and Cayley Numbers: Algebra and Applications", Kluwer Academic Publishers.
Kantor, I. L. and Solodnikov, A. S. (1989), "Hypercomplex numbers, an elementary introduction to algebras", Springer-Verlag, New York,
Gürlebeck, Klaus and Sprössig, Wolfgang (1997), "Quaternionic and Clifford calculus for physicists and engineers". Chichester&; New York&: Wiley (Mathematical v. 1). LCCN
Kuipers, Jack (2002), "Quaternions and Rotation Sequences: A Primer With Applications to Orbits, Aerospace, and Virtual Reality" (reprint edition), .
, and Smith, Derek A. (2003), "On Quaternions and Octonions: Their Geometry, Arithmetic, and Symmetry", A. K. Peters, Ltd.
(2003), "Applied Quaternionic Analysis", Heldermann Verlag .
(2006), "Visualizing Quaternions", Elsevier: Morgan K San Francisco.
(2007), "Natural Geometry of Nonzero Quaternions", International Journal of Theoretical Physics, 46 (2) 251&#, DOI:
Frequently Asked Questions
Includes several papers focusing on computer graphics applications of
quaternions. Covers useful techniques such as spherical linear
interpolation.
Provides free Fortran and C source code for manipulating quaternions
and rotations / position in space. Also includes mathematical
background on quaternions.
Includes free C++ source code for a complete quaternion class suitable
for computer graphics work, under a very liberal license.
3D Raytraced Quaternion
by David J. Grossman
Great page explaining basic math with links to straight forward rotation conversion formulae.
John H. Mathews, .
Andrew Hanson, .
Technical report and Matlab toolbox summarizing all common attitude
representations, with detailed equations and discussion on features of
various methods.
Johan E. Mebius, , arXiv General Mathematics 2005.
Johan E. Mebius, , arXiv General Mathematics 2007.
D. Erickson, Derivation of rotation matrix from unitary quaternion representation in old paper:
Alberto Martinez, University of Texas Department of History, "Negative Math, How Mathematical Rules Can Be Positively Bent",
(1985), , , 19(3), 245-254. Presented at
(1996) is often cited as the first mass-market computer game to have
used quaternions to achieve smooth 3D rotation. See eg Nick Bobick, "", Game Developer magazine, February 1998
. Accessed . See also: Leo Dorst, Daniel Fontijne, Stephen Mann, (2007), , .
A free GUI based utility that converts Euler angles to Quaternions
around X,Y and Z (roll, pitch and yaw) axis and performs conjugate,
addition, subtraction, multiplication, great circle interpolation
operations on converted Quaternions.}

我要回帖

更多关于 最新版gps工具箱官网 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信