⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 implementation notes.txt

📁 四元数matlab工具包
💻 TXT
字号:
Implementation notes--------------------The following are general points about the implementation of the quaterniontoolbox. It is intended to expand these notes in due course to give moredetailed information about the design of the toolbox.1. The representation of a quaternion is hidden in a small number of privatefunctions. This is to keep the bulk of the functions in the library separatefrom the representation, and to facilitate a later change of representationif needed.    2. Functions which are overloadings of Matlab functions generally take thesame parameters as the Matlab function, but there are some exceptions wherethe Matlab function seemed to have unnecessary parameter combinations thatare of little use.3. Functions are inherently matrix-oriented as with standard Matlab functions.4. Errors are limited to cases where parameters are incorrect or not supported.5. Warnings are issued in cases where a result will be incorrect (for examplea NaN, but the computation is not stopped). Generally the problem should befixed at a higher level than the point where the warning occurs. If this is inone of the functions of the toolbox, the problem should be reported, otherwiseif it is user code it should be fixed there.6. Because the toolbox is designed to work with complexified quaternions (thatis quaternions in which the four components are complex), there are some tricksin some of the functions. The modulus of a complex quaternion is complex, and itmay be zero. This has many ramifications. One example suffices to illustrate thetricks needed. In the function unit.m, it is necessary to divide a quaternion byits modulus. There is an error check in the function to give a warning if anyelement of the quaternion array has zero modulus (in fact less than epsilon),but since the modulus may be complex, it is abs(m) that is compared with eps andnot m itself. Note that if the modulus is real, abs(m) == m, and the absfunction has no effect, whereas, if the modulus is complex, abs(m) is real, andit can only be zero if the modulus is zero.7. The overloading of the Matlab functions real, imag and conj is important.real and imag operate exactly as their complex counterparts. Applied to acomplex quaternion they return a real quaternion which is the real or imaginarypart of the complex quaternion, exactly analogous to the complex case. conj,however, is different since it returns the quaternion conjugate by default - thevector part is negated not the complex part of the components. To obtain thecomplex conjugate a second parameter is needed. There is also a total conjugate,which means both the quaternion and complex conjugates are applied. The reasonfor making the default the quaternion conjugate is subtle: conj is used inctranspose and in inverse, and in both of these cases it must be the quaternionconjugate. Therefore for consistency, conj is the quaternion conjugate. The useof a different name (e.g. qconj) was considered but the problem of the 'operator (conjugate transpose) would remain. It is clear that this operatorshould implement the quaternion conjugate transpose because it is this transposethat is needed most often and not the complex conjugate transpose. We can'tintroduce a new operator into Matlab. If we want a complex conjugate transposewe have to write conj(A.', 'complex').Steve SangwineNicolas Le BihanEmail: S.Sangwine@IEEE.org, nicolas.le-bihan@lis.inpg.frLIS, GrenobleJuly 2005Amended March 2006

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -