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 
182 
191 void HTransformTx(double tx,THTransform *t);
192 
201 void HTransformTy(double ty,THTransform *t);
202 
211 void HTransformTz(double tz,THTransform *t);
212 
223 void HTransformTxyz(double tx,double ty,double tz,THTransform *t);
224 
233 void HTransformRx(double rx,THTransform *t);
234 
243 void HTransformRy(double ry,THTransform *t);
244 
253 void HTransformRz(double rz,THTransform *t);
254 
264 void HTransformRx2(double s,double c,THTransform *t);
265 
275 void HTransformRy2(double s,double c,THTransform *t);
276 
286 void HTransformRz2(double s,double c,THTransform *t);
287 
296 void HTransformScale(double s,THTransform *t);
297 
298 
307 void HTransformScaleX(double s,THTransform *t);
308 
317 void HTransformScaleY(double s,THTransform *t);
318 
327 void HTransformScaleZ(double s,THTransform *t);
328 
340 void HTransformCreate(unsigned int dof_r3,double v,THTransform *t);
341 
342 
356 void HTransformSetElement(unsigned int i,unsigned int j,double v,THTransform *t);
357 
369 double HTransformGetElement(unsigned int i,unsigned int j,THTransform *t);
370 
384 void HTransformFromVectors(double *x,double *y,double *z,double *h,THTransform *t);
385 
395 void HTransform2GLMatrix(double *m,THTransform *t);
396 
405 void HTransformFromGLMatrix(double *m,THTransform *t);
416 
427 
437 
465 
486 void HTransformX2Vect(double sy,double sz,
487  double *p1,double *p2,THTransform *t);
488 
503 void HTransformYawPitchRoll(double a,double b,double c,THTransform *t);
504 
528 void GetYawPitchRoll(double *a,double *b,double *c,THTransform *t);
529 
540 
556 void HTransformAcumTrans(double tx,double ty,double tz,THTransform *t);
557 
558 
575 void HTransformAcumTrans2(THTransform *t_in,double tx,double ty,double tz,THTransform *t);
576 
591 void HTransformAcumRot(unsigned int type,double s,double c,THTransform *t);
592 
609 void HTransformAcumRot2(THTransform *t_in,unsigned int type,double s,double c,THTransform *t);
610 
620 void HTransformApply(double *p_in,double *p_out,THTransform *t);
621 
622 
633 void HTransformApplyRot(double *p_in,double *p_out,THTransform *t);
634 
643 void HTransformPrint(FILE *f,THTransform *t);
644 
659 void HTransformPrintT(FILE *f,THTransform *t);
660 
670 void HTransformPrettyPrint(FILE *f,THTransform *t);
671 
680 
681 #endif
Definition of the boolean type.
void HTransformRz2(double s, double c, THTransform *t)
Constructor.
Definition: htransform.c:226
void HTransformApplyRot(double *p_in, double *p_out, THTransform *t)
Multiply the rotation part of the homogeneous transform and a vector.
Definition: htransform.c:747
void GetYawPitchRoll(double *a, double *b, double *c, THTransform *t)
Recovers the Euler angles from a rotation matrix.
Definition: htransform.c:599
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:437
boolean HTransformIsTranslation(THTransform *t)
Identify the translation matrices.
Definition: htransform.c:96
void HTransformPrettyPrint(FILE *f, THTransform *t)
Prints a homogenoeus transform compactly.
Definition: htransform.c:809
A homgeneous transform in R^3.
void HTransformTz(double tz, THTransform *t)
Constructor.
Definition: htransform.c:128
void HTransformScaleY(double s, THTransform *t)
Constructor.
Definition: htransform.c:251
void HTransformRx(double rx, THTransform *t)
Constructor.
Definition: htransform.c:155
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:656
void HTransformRy(double ry, THTransform *t)
Constructor.
Definition: htransform.c:172
void HTransformApply(double *p_in, double *p_out, THTransform *t)
Multiply a homogeneous transform and a vector.
Definition: htransform.c:728
void HTransformScale(double s, THTransform *t)
Constructor.
Definition: htransform.c:233
void HTransform2GLMatrix(double *m, THTransform *t)
Defines a GL column-major matrix from a homogeneous transform.
Definition: htransform.c:351
void HTransformDelete(THTransform *t)
Destructor.
Definition: htransform.c:833
double HTransformGetElement(unsigned int i, unsigned int j, THTransform *t)
Gets an element in a homogeneous transform.
Definition: htransform.c:323
void HTransformTranspose(THTransform *t, THTransform *tt)
Transpose of a homogeneous transform.
Definition: htransform.c:618
void HTransformRz(double rz, THTransform *t)
Constructor.
Definition: htransform.c:189
void HTransformInverse(THTransform *t, THTransform *ti)
Inverse of a homogeneous transform.
Definition: htransform.c:468
void HTransformCreate(unsigned int dof_r3, double v, THTransform *t)
Constructor.
Definition: htransform.c:272
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:140
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:641
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:539
void HTransformProduct(THTransform *t1, THTransform *t2, THTransform *t3)
Product of two homogeneous transforms.
Definition: htransform.c:404
void HTransformFromGLMatrix(double *m, THTransform *t)
Defines homogeneous transform from a GL matrix.
Definition: htransform.c:373
void HTransformScaleZ(double s, THTransform *t)
Constructor.
Definition: htransform.c:259
void HTransformFromVectors(double *x, double *y, double *z, double *h, THTransform *t)
Defines a homogeneous transform from 4 vectors.
Definition: htransform.c:335
void HTransformYawPitchRoll(double a, double b, double c, THTransform *t)
Defines a rotation matrix from the yaw, pitch, and roll parameters.
Definition: htransform.c:590
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:673
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:716
void HTransformPrint(FILE *f, THTransform *t)
Prints the a homogeneous transform to a file.
Definition: htransform.c:768
void HTransformTx(double tx, THTransform *t)
Constructor.
Definition: htransform.c:106
void HTransformSetElement(unsigned int i, unsigned int j, double v, THTransform *t)
Sets an element in a homogeneous transform.
Definition: htransform.c:306
void HTransformScaleX(double s, THTransform *t)
Constructor.
Definition: htransform.c:243
boolean HTransformIsIdentity(THTransform *t)
Identify the identity matrix.
Definition: htransform.c:91
void HTransformTy(double ty, THTransform *t)
Constructor.
Definition: htransform.c:117
void HTransformPrintT(FILE *f, THTransform *t)
Prints the transpose of a homogeneous transform to a file.
Definition: htransform.c:794
#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:206
void HTransformZero(THTransform *t)
Constructor.
Definition: htransform.c:75
void HTransformRy2(double s, double c, THTransform *t)
Constructor.
Definition: htransform.c:216
void HTransformOrthonormalize(THTransform *t, THTransform *ta)
Orthonormalizes the rotation part of a homogenouos transform.
Definition: htransform.c:494