libt3d  2.6
Typedefs | Enumerations | Functions | Variables
C API

Typedefs

typedef enum T3DType T3DType
 Internal representation of a T3D. More...
 
typedef enum T3DBryanIndex T3DBryanIndex
 Tait-Bryan angle names. More...
 
typedef enum V3DVectorIndex V3DVectorIndex
 Vector index values. More...
 

Enumerations

enum  T3DType {
  T3D_MATRIX, T3D_U_MATRIX, T3D_BRYAN, T3D_U_BRYAN,
  T3D_VECTOR, T3D_U_VECTOR
}
 Internal representation of a T3D. More...
 
enum  T3DBryanIndex {
  T3D_BRYAN_YAW, T3D_BRYAN_PITCH, T3D_BRYAN_ROLL, T3D_BRYAN_X,
  T3D_BRYAN_Y, T3D_BRYAN_Z
}
 Tait-Bryan angle names. More...
 
enum  V3DVectorIndex { V3D_VECTOR_X, V3D_VECTOR_Y, V3D_VECTOR_Z }
 Vector index values. More...
 

Functions

R3Dr3dNew (T3DType type, int flags)
 Malloc a new initialized structure for a R3D. More...
 
R3Dr3dInit (R3D *r3d, T3DType type, int flags)
 Initialize a R3D with the type "type". More...
 
R3Dr3dDup (R3D *r3d)
 Malloc a new structure for a R3D and initialize it with r3d. More...
 
void r3dDelete (R3D *r3d)
 Free an malloc'ed R3D. More...
 
T3Dr3dConvertToT3D (R3D *r3d)
 Convert R3d to a generic T3D. More...
 
R3Dr3dConvertTo (T3DType typeTo, R3D *r3d)
 Convert R3D to the "typeTo" representation. More...
 
R3Dr3dCopyIn (R3D *cpy, const R3D *src)
 Copy R3D. More...
 
R3Dr3dInvert (R3D *r3d)
 Invert a R3D. More...
 
R3Dr3dComp (R3D *a, R3D *b)
 Compose two R3D. More...
 
R3Dr3dCompIn (R3D *c, R3D *a, R3D *b)
 Compose two R3D. More...
 
int r3dFPrint (FILE *stream, const R3D *r3d)
 Output a ASCII R3D description on a stream. More...
 
T3Dt3dNew (T3DType type, int flags)
 Malloc a new initialized structure for a tr3d. More...
 
T3Dt3dInit (T3D *t3d, T3DType type, int flags)
 Initialize a T3D with the type "type". More...
 
T3Dt3dCopyIn (T3D *cpy, const T3D *src)
 Copy T3D. More...
 
T3Dt3dInvert (T3D *t3d)
 Invert a T3D. More...
 
T3Dt3dInvertIn (T3D *inv, T3D *t3d)
 Invert T3D. More...
 
T3Dt3dConvertTo (T3DType typeTo, T3D *t3d)
 Convert t3d to the "typeTo" representation. More...
 
T3Dt3dComp (T3D *a, T3D *b)
 Compose two T3D. More...
 
T3Dt3dCompIn (T3D *c, T3D *a, T3D *b)
 Compose two T3D. More...
 
int t3dFPrint (FILE *stream, const T3D *t3d)
 Output a ASCII T3D description on a stream. More...
 
V3Dv3dNew (void)
 Malloc a new initialized structure for a V3D. More...
 
V3Dv3dInit (V3D *v3d)
 Initialize a V3D. More...
 
double v3dNorm (const V3D *v3d)
 Compute euclidian norm of a V3D. More...
 
void v3dNormalize (V3D *v3d)
 Normalize a V3D. More...
 
V3Dv3dApplyT3D (T3D *t3d, V3D *v3d)
 Apply T3D to a V3D. More...
 
double v3dDot (const V3D *a, const V3D *b)
 Vector product. More...
 
double * v3dDotIn (double *c, const V3D *a, const V3D *b)
 Vector product. More...
 
V3Dv3dProd (V3D *a, const V3D *b)
 Vector product. More...
 
V3Dv3dProdIn (V3D *c, const V3D *a, const V3D *b)
 Vector product. More...
 
int v3dFPrint (FILE *stream, const V3D *v3d)
 Output a ASCII V3D description on a stream. More...
 

Variables

const R3D r3dBryanIdentity
 static initializer.
 
const R3D r3dUBryanIdentity
 static initializer.
 
const R3D r3dVectorIdentity
 static initializer.
 
const R3D r3dUVectorIdentity
 static initializer.
 
const R3D r3dMatrixIdentity
 static initializer.
 
const R3D r3dUMatrixIdentity
 static initializer.
 
const T3D t3dBryanIdentity
 static initializer.
 
const T3D t3dUBryanIdentity
 static initializer.
 
const T3D t3dVectorIdentity
 static initializer.
 
const T3D t3dUVectorIdentity
 static initializer.
 
const T3D t3dMatrixIdentity
 static initializer.
 
const T3D t3dUMatrixIdentity
 static initializer.
 

Detailed Description

Typedef Documentation

◆ T3DBryanIndex

Tait-Bryan angle names.

Use this enumerator with Tait-Bryan angle accessors.

◆ T3DType

typedef enum T3DType T3DType

Internal representation of a T3D.

This value can be supplied to t3dNew() or T3D() contstructor.

◆ V3DVectorIndex

Vector index values.

Use this enumerator with V3D coordinates accessors.

Enumeration Type Documentation

◆ T3DBryanIndex

Tait-Bryan angle names.

Use this enumerator with Tait-Bryan angle accessors.

Enumerator
T3D_BRYAN_YAW 

Yaw angle or Z-axis rotation.

T3D_BRYAN_PITCH 

Pitch angle or Y-axis rotation.

T3D_BRYAN_ROLL 

Roll angle or X-axis rotation.

T3D_BRYAN_X 

Translation on X-axis.

T3D_BRYAN_Y 

Translation on Y-axis.

T3D_BRYAN_Z 

Translation on Z-axis.

◆ T3DType

enum T3DType

Internal representation of a T3D.

This value can be supplied to t3dNew() or T3D() contstructor.

Enumerator
T3D_MATRIX 

Homogeneous matrix.

T3D_U_MATRIX 

Uncertain homogeneous matrix.

T3D_BRYAN 

Bryan angles and translation.

T3D_U_BRYAN 

Uncertain bryan angles and translation.

T3D_VECTOR 

Rotation vector.

T3D_U_VECTOR 

Uncertain rotation vector.

◆ V3DVectorIndex

Vector index values.

Use this enumerator with V3D coordinates accessors.

Enumerator
V3D_VECTOR_X 

X coordinate.

V3D_VECTOR_Y 

Y coordinate.

V3D_VECTOR_Z 

Z coordinate.

Function Documentation

◆ r3dComp()

R3D* r3dComp ( R3D a,
R3D b 
)

Compose two R3D.

Compose R3D a with T3D b, store the result in c and return c. See t3dComp().

Parameters
[out]aFirst transformation.
[in]bSecond transformation, applied after a.
Returns
a, updated.

◆ r3dCompIn()

R3D* r3dCompIn ( R3D c,
R3D a,
R3D b 
)

Compose two R3D.

Compose R3D a with T3D b, store the result in c and return c. See t3dComp().

Parameters
[out]cResulting transformation.
[in]aFirst transformation.
[in]bSecond transformation, applied after a.
Returns
c.

◆ r3dConvertTo()

R3D* r3dConvertTo ( T3DType  typeTo,
R3D r3d 
)

Convert R3D to the "typeTo" representation.

Parameters
[in]typeToType to convert to.
[in]r3dR3D object to convert.
Returns
r3d, converted.

◆ r3dConvertToT3D()

T3D* r3dConvertToT3D ( R3D r3d)

Convert R3d to a generic T3D.

Parameters
[in]r3dR3D object to convert.
Returns
r3d, converted.

◆ r3dCopyIn()

R3D* r3dCopyIn ( R3D cpy,
const R3D src 
)

Copy R3D.

Copy src in cpy. We do not copy more bytes than what the type of the R3D says. The function return a pointer on the copy.

Parameters
[out]cpyDestination.
[in]srcR3D to copy.
Returns
cpy.

◆ r3dDelete()

void r3dDelete ( R3D r3d)

Free an malloc'ed R3D.

Parameters
[in]r3dR3D object.

◆ r3dDup()

R3D* r3dDup ( R3D r3d)

Malloc a new structure for a R3D and initialize it with r3d.

Parameters
[in]r3dR3D object to duplicate.
Returns
pointer on copied R3D.

◆ r3dFPrint()

int r3dFPrint ( FILE *  stream,
const R3D r3d 
)

Output a ASCII R3D description on a stream.

Parameters
[in]streamStream to dump on.
[in]r3dR3D to dump.
Returns
the number of byte written.

◆ r3dInit()

R3D* r3dInit ( R3D r3d,
T3DType  type,
int  flags 
)

Initialize a R3D with the type "type".

The size of the new structure is compatible with any type of representation except if the T3D_MINIMAL_SIZE flag is present (in this case the allocated size is minimal).

Parameters
[in]r3dPointer to an allocated R3D.
[in]typeType of internal representation.
[in]flagsFlags for special behaviors.
Returns
A pointer to the initialized R3D (equal to `r3d' parameter).

◆ r3dInvert()

R3D* r3dInvert ( R3D r3d)

Invert a R3D.

The R3D might be converted to another representation for doing this, and since not all conversion are possible, you might want to check errno. Note that the R3D is overwritten.

Parameters
[in]r3dR3D object.
Returns
r3d, inverted.

◆ r3dNew()

R3D* r3dNew ( T3DType  type,
int  flags 
)

Malloc a new initialized structure for a R3D.

Calls r3dInit() with an malloc'ed structure. Storage must be released with r3dDelete().

Parameters
[in]typeType of internal representation.
[in]flagsFlags for special behaviors.
Returns
A pointer to the initialized R3D.

◆ t3dComp()

T3D* t3dComp ( T3D a,
T3D b 
)

Compose two T3D.

Compose T3D a with T3D b, that is compute a T3D that is the combination of first applying a and then b. The result is stored in a and a is returned.

If a represents the transformation from a frame A to a frame X and b represents the transformation from a frame X to a frame B, the result of this fonction is a transformation from the frame A to the frame B. Or for short : t3Comp("A_2_X", "X_2_B") = "A_2_B".

Note that if T3D has an internal type of T3D_MATRIX, the result of this function is the product of matrix b by matrix a.

Parameters
[out]aFirst transformation.
[in]bSecond transformation, applied after a.
Returns
a updated.

◆ t3dCompIn()

T3D* t3dCompIn ( T3D c,
T3D a,
T3D b 
)

Compose two T3D.

Compose T3D a with T3D b, store the result in c and return c. See t3dComp().

Parameters
[out]cResulting transformation.
[in]aFirst transformation.
[in]bSecond transformation, applied after a.
Returns
c.

◆ t3dConvertTo()

T3D* t3dConvertTo ( T3DType  typeTo,
T3D t3d 
)

Convert t3d to the "typeTo" representation.

Parameters
[in]typeToType to convert to.
[in]t3dT3D object to convert.
Returns
t3d, converted.

◆ t3dCopyIn()

T3D* t3dCopyIn ( T3D cpy,
const T3D src 
)

Copy T3D.

Copy src in cpy. We do not copy more bytes than what the type of the T3D says. The function return a pointer on the copy.

Parameters
[out]cpyDestination.
[in]srcT3D to copy.
Returns
cpy.

◆ t3dFPrint()

int t3dFPrint ( FILE *  stream,
const T3D t3d 
)

Output a ASCII T3D description on a stream.

Parameters
[in]streamStream to dump on.
[in]t3dT3D to dump.
Returns
the number of byte written.

◆ t3dInit()

T3D* t3dInit ( T3D t3d,
T3DType  type,
int  flags 
)

Initialize a T3D with the type "type".

The size of the new structure is compatible with any type of representation except if the T3D_MINIMAL_SIZE flag is present (in this case the allocated size is minimal).

Parameters
[in]t3dPointer to an allocated T3D.
[in]typeType of internal representation.
[in]flagsFlags for special behaviors.
Returns
A pointer to the initialized T3D (equal to `t3d' parameter).

◆ t3dInvert()

T3D* t3dInvert ( T3D t3d)

Invert a T3D.

The T3D might be converted to another representation for doing this, and since not all conversion are possible, you might want to check errno. Note that the T3D is overwritten.

Parameters
[in]t3dT3D object.
Returns
t3d, inverted.

◆ t3dInvertIn()

T3D* t3dInvertIn ( T3D inv,
T3D t3d 
)

Invert T3D.

Invert T3D `a', store the result in c and return c. See t3Invert().

Parameters
[in]t3dT3D object.
[in]invWhere to store the inverse.
Returns
inv, equel to the inverse of t3d.

◆ t3dNew()

T3D* t3dNew ( T3DType  type,
int  flags 
)

Malloc a new initialized structure for a tr3d.

Calls t3dInit() with an malloc'ed structure. Storage must be released with t3dDelete().

Parameters
[in]typeType of internal representation.
[in]flagsFlags for special behaviors.
Returns
A pointer to the initialized T3D.

◆ v3dApplyT3D()

V3D* v3dApplyT3D ( T3D t3d,
V3D v3d 
)

Apply T3D to a V3D.

Parameters
[in]t3dTransformation.
[in]v3dVector to be transformed.
Returns
the transformed vector (equal to `v3d').

◆ v3dDot()

double v3dDot ( const V3D a,
const V3D b 
)

Vector product.

Parameters
[in]aFirst vector
[in]bSecond vector
Returns
a pointer on `a', containing the result of the dot product.

◆ v3dDotIn()

double* v3dDotIn ( double *  c,
const V3D a,
const V3D b 
)

Vector product.

Parameters
[out]cResulting vector
[in]aFirst vector
[in]bSecond vector
Returns
c, containing the result of the cross product.

◆ v3dFPrint()

int v3dFPrint ( FILE *  stream,
const V3D v3d 
)

Output a ASCII V3D description on a stream.

Parameters
[in]streamStream to dump on.
[in]v3dV3D to dump.
Returns
the number of byte written.

◆ v3dInit()

V3D* v3dInit ( V3D v3d)

Initialize a V3D.

Parameters
[in]v3dPointer to an allocated V3D.
Returns
A pointer to the initialized V3D (equal to `v3d' parameter).

◆ v3dNew()

V3D* v3dNew ( void  )

Malloc a new initialized structure for a V3D.

Calls v3dInit() with an malloc'ed structure. Storage must be released with v3dDelete().

Returns
A pointer to the initialized V3D.

◆ v3dNorm()

double v3dNorm ( const V3D v3d)

Compute euclidian norm of a V3D.

Parameters
[in]v3dInput vector
Returns
the euclidian norm of the vector.

◆ v3dNormalize()

void v3dNormalize ( V3D v3d)

Normalize a V3D.

Parameters
[in,out]v3dInput vector.
Returns
the normalized vector.

◆ v3dProd()

V3D* v3dProd ( V3D a,
const V3D b 
)

Vector product.

Parameters
[in]aFirst vector
[in]bSecond vector
Returns
a pointer on `a', containing the result of the cross product.

◆ v3dProdIn()

V3D* v3dProdIn ( V3D c,
const V3D a,
const V3D b 
)

Vector product.

Parameters
[out]cResulting vector
[in]aFirst vector
[in]bSecond vector
Returns
c, containing the result of the cross product.