htransform.h
Go to the documentation of this file.
1 #ifndef HTRANSFORMH
2 #define HTRANSFORMH
3 
4 #include "boolean.h"
5 #include "defines.h" /*for the DIM_SP,... constants*/
6 
7 #include <stdio.h>
8 
20 /************************************************************************************/
27 #define DIM_SP 3
28 
35 #define TX 0
36 
43 #define TY 1
44 
51 #define TZ 2
52 
59 #define RX 3
60 
67 #define RY 4
68 
75 #define RZ 5
76 
83 #define AXIS_X 0
84 
91 #define AXIS_Y 1
92 
99 #define AXIS_Z 2
100 
108 #define AXIS_H 3
109 /************************************************************************************/
110 
129 typedef double THTransform[DIM_SP+1][DIM_SP+1];
130 
139 
147 void HTransformZero(THTransform *t);
148 
157 void HTransformCopy(THTransform *t_dst,THTransform *t_org);
158 
168 boolean HTransformIsIdentity(THTransform *t);
169 
179 boolean HTransformIsZero(THTransform *t);
180 
193 
202 void HTransformTx(double tx,THTransform *t);
203 
212 void HTransformTy(double ty,THTransform *t);
213 
222 void HTransformTz(double tz,THTransform *t);
223 
234 void HTransformTxyz(double tx,double ty,double tz,THTransform *t);
235 
244 void HTransformRx(double rx,THTransform *t);
245 
254 void HTransformRy(double ry,THTransform *t);
255 
264 void HTransformRz(double rz,THTransform *t);
265 
275 void HTransformRx2(double s,double c,THTransform *t);
276 
286 void HTransformRy2(double s,double c,THTransform *t);
287 
297 void HTransformRz2(double s,double c,THTransform *t);
298 
307 void HTransformScale(double s,THTransform *t);
308 
309 
318 void HTransformScaleX(double s,THTransform *t);
319 
328 void HTransformScaleY(double s,THTransform *t);
329 
338 void HTransformScaleZ(double s,THTransform *t);
339 
351 void HTransformCreate(unsigned int dof_r3,double v,THTransform *t);
352 
353 
367 void HTransformSetElement(unsigned int i,unsigned int j,double v,THTransform *t);
368 
380 double HTransformGetElement(unsigned int i,unsigned int j,THTransform *t);
381 
395 void HTransformFromVectors(double *x,double *y,double *z,double *h,THTransform *t);
396 
406 void HTransform2GLMatrix(double *m,THTransform *t);
407 
416 void HTransformFromGLMatrix(double *m,THTransform *t);
427 
438 
449 
459 
487 
508 void HTransformX2Vect(double sy,double sz,
509  double *p1,double *p2,THTransform *t);
510 
525 void HTransformYawPitchRoll(double a,double b,double c,THTransform *t);
526 
550 void GetYawPitchRoll(double *a,double *b,double *c,THTransform *t);
551 
562 
578 void HTransformAcumTrans(double tx,double ty,double tz,THTransform *t);
579 
580 
597 void HTransformAcumTrans2(THTransform *t_in,double tx,double ty,double tz,THTransform *t);
598 
613 void HTransformAcumRot(unsigned int type,double s,double c,THTransform *t);
614 
631 void HTransformAcumRot2(THTransform *t_in,unsigned int type,double s,double c,THTransform *t);
632 
642 void HTransformApply(double *p_in,double *p_out,THTransform *t);
643 
644 
655 void HTransformApplyRot(double *p_in,double *p_out,THTransform *t);
656 
665 void HTransformPrint(FILE *f,THTransform *t);
666 
681 void HTransformPrintT(FILE *f,THTransform *t);
682 
692 void HTransformPrettyPrint(FILE *f,THTransform *t);
693 
702 
703 #endif
Definition of the boolean type.
void HTransformRz2(double s, double c, THTransform *t)
Constructor.
Definition: htransform.c:232
void HTransformApplyRot(double *p_in, double *p_out, THTransform *t)
Multiply the rotation part of the homogeneous transform and a vector.
Definition: htransform.c:801
void GetYawPitchRoll(double *a, double *b, double *c, THTransform *t)
Recovers the Euler angles from a rotation matrix.
Definition: htransform.c:634
void HTransformIdentity(THTransform *t)
Constructor.
Definition: htransform.c:69
void HTransformAdd(THTransform *t1, THTransform *t2, THTransform *t3)
Addition of two homogeneous transforms.
Definition: htransform.c:443
boolean HTransformIsTranslation(THTransform *t)
Identify the translation matrices.
Definition: htransform.c:102
void HTransformPrettyPrint(FILE *f, THTransform *t)
Prints a homogenoeus transform compactly.
Definition: htransform.c:863
A homgeneous transform in R^3.
void HTransformSubstract(THTransform *t1, THTransform *t2, THTransform *t3)
Substraction of two homogeneous transforms.
Definition: htransform.c:472
void HTransformTz(double tz, THTransform *t)
Constructor.
Definition: htransform.c:134
void HTransformScaleY(double s, THTransform *t)
Constructor.
Definition: htransform.c:257
void HTransformRx(double rx, THTransform *t)
Constructor.
Definition: htransform.c:161
void HTransformAcumTrans2(THTransform *t_in, double tx, double ty, double tz, THTransform *t)
Computes the result of multiplying a homogeneous transform by a translation matrix with parameters tx...
Definition: htransform.c:710
void HTransformRy(double ry, THTransform *t)
Constructor.
Definition: htransform.c:178
void HTransformApply(double *p_in, double *p_out, THTransform *t)
Multiply a homogeneous transform and a vector.
Definition: htransform.c:782
void HTransformScale(double s, THTransform *t)
Constructor.
Definition: htransform.c:239
void HTransform2GLMatrix(double *m, THTransform *t)
Defines a GL column-major matrix from a homogeneous transform.
Definition: htransform.c:357
void HTransformDelete(THTransform *t)
Destructor.
Definition: htransform.c:887
double HTransformGetElement(unsigned int i, unsigned int j, THTransform *t)
Gets an element in a homogeneous transform.
Definition: htransform.c:329
void HTransformTranspose(THTransform *t, THTransform *tt)
Transpose of a homogeneous transform.
Definition: htransform.c:672
void HTransformRz(double rz, THTransform *t)
Constructor.
Definition: htransform.c:195
void HTransformInverse(THTransform *t, THTransform *ti)
Inverse of a homogeneous transform.
Definition: htransform.c:503
void HTransformCreate(unsigned int dof_r3, double v, THTransform *t)
Constructor.
Definition: htransform.c:278
boolean HTransformIsZero(THTransform *t)
Identify the zero matrix.
Definition: htransform.c:97
Definitions of constants and macros used in several parts of the cuik library.
void HTransformTxyz(double tx, double ty, double tz, THTransform *t)
Constructor.
Definition: htransform.c:146
void HTransformAcumTrans(double tx, double ty, double tz, THTransform *t)
Computes the result of multiplying a homogeneous transform by a translation matrix with parameters tx...
Definition: htransform.c:695
void HTransformX2Vect(double sy, double sz, double *p1, double *p2, THTransform *t)
Transform a unitary vector along the X axis to a generic vector.
Definition: htransform.c:574
void HTransformProduct(THTransform *t1, THTransform *t2, THTransform *t3)
Product of two homogeneous transforms.
Definition: htransform.c:410
void HTransformFromGLMatrix(double *m, THTransform *t)
Defines homogeneous transform from a GL matrix.
Definition: htransform.c:379
void HTransformScaleZ(double s, THTransform *t)
Constructor.
Definition: htransform.c:265
void HTransformFromVectors(double *x, double *y, double *z, double *h, THTransform *t)
Defines a homogeneous transform from 4 vectors.
Definition: htransform.c:341
void HTransformYawPitchRoll(double a, double b, double c, THTransform *t)
Defines a rotation matrix from the yaw, pitch, and roll parameters.
Definition: htransform.c:625
void HTransformAcumRot(unsigned int type, double s, double c, THTransform *t)
Computes the result of multiplying a homogeneous transform by a rotation matrix.
Definition: htransform.c:727
void HTransformAcumRot2(THTransform *t_in, unsigned int type, double s, double c, THTransform *t)
Computes the result of multiplying a homogeneous transform by a rotation matrix.
Definition: htransform.c:770
void HTransformPrint(FILE *f, THTransform *t)
Prints the a homogeneous transform to a file.
Definition: htransform.c:822
void HTransformTx(double tx, THTransform *t)
Constructor.
Definition: htransform.c:112
void HTransformSetElement(unsigned int i, unsigned int j, double v, THTransform *t)
Sets an element in a homogeneous transform.
Definition: htransform.c:312
void HTransformScaleX(double s, THTransform *t)
Constructor.
Definition: htransform.c:249
boolean HTransformIsIdentity(THTransform *t)
Identify the identity matrix.
Definition: htransform.c:91
void HTransformTy(double ty, THTransform *t)
Constructor.
Definition: htransform.c:123
void HTransformPrintT(FILE *f, THTransform *t)
Prints the transpose of a homogeneous transform to a file.
Definition: htransform.c:848
#define DIM_SP
Dimensions of R^3.
Definition: htransform.h:27
void HTransformCopy(THTransform *t_dst, THTransform *t_org)
Copy constructor.
Definition: htransform.c:83
void HTransformRx2(double s, double c, THTransform *t)
Constructor.
Definition: htransform.c:212
void HTransformZero(THTransform *t)
Constructor.
Definition: htransform.c:75
void HTransformRy2(double s, double c, THTransform *t)
Constructor.
Definition: htransform.c:222
void HTransformOrthonormalize(THTransform *t, THTransform *ta)
Orthonormalizes the rotation part of a homogenouos transform.
Definition: htransform.c:529