| V_Sim API - Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#define TOOL_XYZ_MASK_ALL #define TOOL_XYZ_MASK_X #define TOOL_XYZ_MASK_Y #define TOOL_XYZ_MASK_Z struct ToolGridSize; enum ToolMatrixScalingFlag; enum ToolMatrixSphericalCoord; struct ToolVector; void tool_matrix_cartesianToSpherical (float *spherical,float *cartesian); float tool_matrix_determinant (float mat[3][3]); void tool_matrix_dtof (float mf[3][3],double md[3][3]); gboolean tool_matrix_getInter2D (float *lambda,float a[2],float b[2],float A[2],float B[2]); gboolean tool_matrix_getInter2DFromList (float i[2],float *lambda,float a[2],float b[2],GList *set); gboolean tool_matrix_getRotationFromFull (float rot[3][3],double full[3][3],double box[6]); double tool_matrix_getScaledLinear (double x,double minmax[2]); double tool_matrix_getScaledLinearInv (double x,double minmax[2]); double tool_matrix_getScaledLog (double x,double minmax[2]); double tool_matrix_getScaledLogInv (double x,double minmax[2]); double (*tool_matrix_getScaledValue) (double x,double minmax[2]); double tool_matrix_getScaledZeroCentredLog (double x,double minmax[2]); double tool_matrix_getScaledZeroCentredLogInv (double x,double minmax[2]); void tool_matrix_init (void); gboolean tool_matrix_invert (float inv[3][3],float mat[3][3]); void tool_matrix_productMatrix (float matRes[3][3],float matA[3][3],float matB[3][3]); void tool_matrix_productVector (float vectRes[3],float mat[3][3],float vect[3]); gboolean tool_matrix_reducePrimitiveVectors (double reduced[6],double full[3][3]); void tool_matrix_setIdentity (float mat[3][3]); void tool_matrix_sphericalToCartesian (float *cartesian,float *spherical);
Some very basic linear algebra are redefined here. It also gives access to coordinates conversion, essentially between cartesian and spherical.
#define TOOL_XYZ_MASK_ALL (7)
This value can be used to create a mask for methods that require one for reading xyz coordinates array. This value is a shortcut for TOOL_XYZ_MASK_X | TOOL_XYZ_MASK_Y | TOOL_XYZ_MASK_Z.
Since 3.3
#define TOOL_XYZ_MASK_X (1 << 0)
This value can be used to create a mask for methods that require one for reading xyz coordinates array. This value actually correspond to the x direction.
Since 3.3
#define TOOL_XYZ_MASK_Y (1 << 1)
This value can be used to create a mask for methods that require one for reading xyz coordinates array. This value actually correspond to the y direction.
Since 3.3
#define TOOL_XYZ_MASK_Z (1 << 2)
This value can be used to create a mask for methods that require one for reading xyz coordinates array. This value actually correspond to the z direction.
Since 3.3
struct ToolGridSize {
guint grid[3];
};
Structure used for bindings.
guint |
. [array fixed-size=3][element-type guint] |
Since 3.7
typedef enum {
TOOL_MATRIX_SCALING_LINEAR,
TOOL_MATRIX_SCALING_LOG,
TOOL_MATRIX_SCALING_ZERO_CENTRED_LOG,
TOOL_MATRIX_SCALING_N_VALUES
} ToolMatrixScalingFlag;
Flag used to specify the transformation for scalarFieldDraw_map()
routine.
| a linear convertion from [min,max] to [0,1] ; | |
| a TOOL_MATRIX_SCALING_LOGic transformation from [min,max] to [0,1], the formula is -(f(x) - f(m) / f(m) where f(x) = ln((x-xmin)/(xmax-xmin)) ; | |
| a TOOL_MATRIX_SCALING_LOGic transformation for data that are zero centred, the formula is 0.5+s*(log(MAX*SEUIL)-log(max(abs(x),MAX*SEUIL)))/(2*log(SEUIL)) where s is the sign, max=max(xmax,-xmin) and seuil a parameter (1e-5). | |
| number of available scale functions. |
Since 3.4
typedef enum {
TOOL_MATRIX_SPHERICAL_MODULUS,
TOOL_MATRIX_SPHERICAL_THETA,
TOOL_MATRIX_SPHERICAL_PHI
} ToolMatrixSphericalCoord;
This is used to access the ordering of the vectors with
tool_matrix_cartesianToSpherical() or with
tool_matrix_sphericalToCartesian().
| the modulus of a spherical vector. | |
| the theta angle of a spherical vector. | |
| the phi angle of a spherical vector. |
Since 3.6
void tool_matrix_cartesianToSpherical (float *spherical,float *cartesian);
A method to transform cartesian coordinates in spherical coordinates (radius, phi and theta).
|
an allocated array of 3 floating point values to store the result ; |
|
an allocated array of 3 floating point values to read the input. |
Since 3.3
float tool_matrix_determinant (float mat[3][3]);
Calculate the determinant of matrix mat.
|
a matrix. |
Returns : |
the determinant value. |
Since 3.6
void tool_matrix_dtof (float mf[3][3],double md[3][3]);
Cast md into mf.
|
a matrix in single precision. |
|
a matrix in double precision. |
Since 3.7
gboolean tool_matrix_getInter2D (float *lambda,float a[2],float b[2],float A[2],float B[2]);
Get the intersection coeeficient of lines [ab] and [AB].
|
a location to store a float. |
|
a point. |
|
another point. |
|
a point. |
|
another point. |
Returns : |
TRUE if [ab] and [AB] have an intersection. |
gboolean tool_matrix_getInter2DFromList (float i[2],float *lambda,float a[2],float b[2],GList *set);
Same as tool_matrix_getInter2D(), but from a list of points.
|
a location to store a point. |
|
a location to store a float. |
|
a point. |
|
another point. |
|
a list of points. |
Returns : |
TRUE if an intersection exists. |
gboolean tool_matrix_getRotationFromFull (float rot[3][3],double full[3][3],double box[6]);
There is a rotation matrix to transform from full cartesian coordinates into reduced box cartesian coordinates.
|
a rotation matrix (out values). |
|
the description of basis set in full development. |
|
the description of basis set in align X axis. |
Returns : |
TRUE if full does not describe properly a 3D box. |
Since 3.6
double tool_matrix_getScaledLinear (double x,double minmax[2]);
Transform x into [0;1] with a linear scale.
|
the initial value ; |
|
the boundaries for the x argument ; |
Returns : |
a value into [0;1]. |
Since 3.5
double tool_matrix_getScaledLinearInv (double x,double minmax[2]);
Reverse function for tool_matrix_getScaledLinear().
|
the initial value ; |
|
the boundaries for the x argument. |
Returns : |
a value into [0;1]. |
Since 3.5
double tool_matrix_getScaledLog (double x,double minmax[2]);
Transform x into [0;1] with a log scale.
|
the initial value ; |
|
the boundaries for the x argument. |
Returns : |
a value into [0;1]. |
Since 3.5
double tool_matrix_getScaledLogInv (double x,double minmax[2]);
Reverse function for tool_matrix_getScaledLog().
|
the initial value ; |
|
the boundaries for the x argument. |
Returns : |
a value into [0;1]. |
Since 3.5
double (*tool_matrix_getScaledValue) (double x,double minmax[2]);
Transform x into [0;1] using the given minmax values.
|
the initial value ; |
|
the boundaries for the x argument. |
Returns : |
a value into [0;1]. |
Since 3.4
double tool_matrix_getScaledZeroCentredLog (double x,double minmax[2]);
Transform x into [0;1] with a log scale with zero centred values.
|
the initial value ; |
|
the boundaries for the x argument. |
Returns : |
a value into [0;1]. |
Since 3.5
double tool_matrix_getScaledZeroCentredLogInv (double x,double minmax[2]);
Reverse function for tool_matrix_getScaledZeroCentredLog().
|
the initial value ; |
|
the boundaries for the x argument. |
Returns : |
a value into [0;1]. |
Since 3.5
void tool_matrix_init (void);
This method is used by V_Sim internally and should not be called.
Since 3.5
gboolean tool_matrix_invert (float inv[3][3],float mat[3][3]);
Calculate the inverse matrix of matrix mat and store it in inv.
|
a matrix (out values). |
|
a matrix. |
Returns : |
FALSE if mat is singular. |
Since 3.6
void tool_matrix_productMatrix (float matRes[3][3],float matA[3][3],float matB[3][3]);
Compute the mathematical product between matA and matB and
put the result matrix in matRes.
|
an array of floating point values of size 3x3 ; |
|
an array of floating point values of size 3x3 ; |
|
an array of floating point values of size 3x3. |
Since 3.2
void tool_matrix_productVector (float vectRes[3],float mat[3][3],float vect[3]);
Compute the mathematical product between matA and vect and
put the result vector in vectRes.
|
an array of floating point values of size 3 ; |
|
an array of floating point values of size 3x3 ; |
|
an array of floating point values of size 3. |
Since 3.2
gboolean tool_matrix_reducePrimitiveVectors (double reduced[6],double full[3][3]);
This routine transforms the given matrix full into a reduced array
used by V_Sim to store box definition.
|
a storage for 6 floating point values ;. [out caller-allocates][array fixed-size=6] |
|
a full 3x3 matrix to be transformed. [in][array fixed-size=9] |
Returns : |
FALSE if the given matrix is planar. |
void tool_matrix_setIdentity (float mat[3][3]);
Initialise mat with the identity.
|
a matrix location. [array fixed-size=9] |
Since 3.7
void tool_matrix_sphericalToCartesian (float *cartesian,float *spherical);
A method to transform spherical coordinates (radius, phi and theta) to cartesian coordinates.
|
an allocated array of 3 floating point values to store the result ; |
|
an allocated array of 3 floating point values to read the input. |
Since 3.3