Home | Develop | Download | Contact
pdsquaternion.h
1 /*
2  * pdsquaternion.h
3  *
4  * Copyright 2011 Fernando Pujaico Rivera <fernando.pujaico.rivera@gmail.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301, USA.
20  *
21  */
22 
29 #ifndef __PDSQUATERNION_H__
30 #define __PDSQUATERNION_H__
31 
32 
33 #include <pds/pdscnglobal.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
54 typedef struct
55 {
65 
66 
67 
72 #define PDS_QRECT(A,B,C,D) pds_quaternion_rect(A,B,C,D)
73 
87 
88 
89 
94 #define PDS_QPOLAR(A,B,C,D) pds_quaternion_polar(A,B,C,D)
95 
110 
111 
112 
117 #define PDS_QADDQ(A,B) pds_quaternion_add_quaternion(A,B)
118 
127 
128 
129 
134 #define PDS_QADDR(A,B) pds_quaternion_add_real(A,B)
135 
144 
145 
146 
151 #define PDS_QSUBQ(A,B) pds_quaternion_sub_quaternion(A,B)
152 
161 
162 
163 
168 #define PDS_QSUBR(A,B) pds_quaternion_sub_real(A,B)
169 
178 
179 
184 #define PDS_QMULQ(A,B) pds_quaternion_mul_quaternion(A,B)
185 
194 
195 
196 
201 #define PDS_QMULR(A,B) pds_quaternion_mul_real(A,B)
202 
211 
212 
217 #define PDS_QDIVQ(A,B) pds_quaternion_div_quaternion(A,B)
218 
227 
228 
229 
234 #define PDS_QDIVR(A,B) pds_quaternion_div_real(A,B)
235 
244 
245 
250 #define PDS_QINV(A) pds_quaternion_inv(A)
251 
263 
264 
269 #define PDS_QUNIT(A) pds_quaternion_unit(A)
270 
282 
283 
288 #define PDS_QCONJ(A) pds_quaternion_conj(A)
289 
301 
302 
307 #define PDS_QEXP(B) pds_quaternion_exp(B)
308 
320 
325 #define PDS_QLOG(B) pds_quaternion_log(B)
326 
339 
344 #define PDS_QPOW(B,a) pds_quaternion_pow(B,a)
345 
360 
361 
366 #define PDS_QNORM(A) pds_quaternion_norm(A)
367 
378 
379 
380 
385 #define PDS_QNORM2(A) pds_quaternion_norm2(A)
386 
397 
403 #define PDS_QGYRO(Wx,Wy,Wz,dt) pds_quaternion_gyro(Wx,Wy,Wz,dt)
404 
428 
429 
434 #ifdef __cplusplus
435 }
436 #endif
437 
438 
439 #endif /* __PDSQUATERNION_H__ */
float PdsCnReal
Definition: pdscnglobal.h:46
PdsQuaternion pds_quaternion_unit(PdsQuaternion a)
Retona un quaternio unitario de un quaternio a. b=a/|a|.
PdsQuaternion pds_quaternion_conj(PdsQuaternion a)
Retona el conjugado de un quaternio. b=a.W-a.X i-a.Y j-a.Z k.
PdsQuaternion pds_quaternion_polar(PdsCnReal a, PdsCnReal b, PdsCnReal c, PdsCnReal d)
Evalua de forma polar. ae^{bi+cj+dk}.
PdsQuaternion pds_quaternion_pow(PdsQuaternion q, PdsCnReal a)
Evalua pow(q,a),q=W+Xi+Yj+Zk, siendo &#39;a&#39; real.
PdsQuaternion pds_quaternion_rect(PdsCnReal w, PdsCnReal x, PdsCnReal y, PdsCnReal z)
Crea la variable complejas. q=w+xi+yi+zi.
PdsCnReal pds_quaternion_norm2(PdsQuaternion a)
Evalua |a|^2. |a|^2=(a.W^2+a.X^2+a.Y^2+a.Z^2).
PdsQuaternion pds_quaternion_gyro(PdsCnReal Wx, PdsCnReal Wy, PdsCnReal Wz, PdsCnReal dt)
Retorna un quaternio de giro q, provocado por el vetor de velocidad angular W = (Wx,Wy,Wz) = Wx i + Wy j + Wz k con un tiempo hasta la muestra anterior de &#39;dt&#39;.
La estructura tipo PdsQuaternion .
Definition: pdsquaternion.h:54
PdsQuaternion pds_quaternion_div_quaternion(PdsQuaternion a, PdsQuaternion b)
Divide dos quaternios. a/b
PdsCnReal Z
Definition: pdsquaternion.h:63
PdsQuaternion pds_quaternion_add_real(PdsQuaternion a, PdsCnReal b)
Suma un quaternio y una real. a+b.
PdsQuaternion pds_quaternion_sub_quaternion(PdsQuaternion a, PdsQuaternion b)
Resta dos quaternios. a-b.
PdsQuaternion pds_quaternion_inv(PdsQuaternion a)
Retona el inverso de un quaternio a. b=a^{-1}.
PdsQuaternion pds_quaternion_div_real(PdsQuaternion a, PdsCnReal b)
Divide un quaternio y una real. a/b.
PdsCnReal Y
Definition: pdsquaternion.h:61
PdsCnReal W
Definition: pdsquaternion.h:57
PdsQuaternion pds_quaternion_exp(PdsQuaternion q)
Evalua exp(q),q=W+Xi+Yj+Zk.
PdsCnReal pds_quaternion_norm(PdsQuaternion a)
Evalua |a|. |a|=sqrt(a.W^2+a.X^2+a.Y^2+a.Z^2).
PdsQuaternion pds_quaternion_sub_real(PdsQuaternion a, PdsCnReal b)
Resta un quaternio y una real. a-b
PdsQuaternion pds_quaternion_add_quaternion(PdsQuaternion a, PdsQuaternion b)
Suma dos quaternios. a+b.
PdsQuaternion pds_quaternion_mul_quaternion(PdsQuaternion a, PdsQuaternion b)
Multiplica dos quaternios. a*b.
PdsCnReal X
Definition: pdsquaternion.h:59
PdsQuaternion pds_quaternion_mul_real(PdsQuaternion a, PdsCnReal b)
Multiplica un quaternio y una real. a*b.
PdsQuaternion pds_quaternion_log(PdsQuaternion q)
Evalua ln(q),q=W+Xi+Yj+Zk.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed