![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
void matrix_sphericalToCartesian (float *cartesian, float *spherical); void matrix_productMatrix (float matRes[3][3], float matA[3][3], float matB[3][3]); void matrix_cartesianToSpherical (float *spherical, float *cartesian); gboolean matrix_reducePrimitiveVectors (double reduced[6], double full[3][3]); void matrix_productVector (float vectRes[3], float mat[3][3], float vect[3]); enum matrix_scaleflag; double matrixGet_invLinear (double x, double minmax[2], double param); double matrixGet_invLogarithm (double x, double minmax[2], double param); double matrixGet_invZeroCenteredLog (double x, double minmax[2], double param); double matrixGet_linear (double x, double minmax[2], double param); double matrixGet_logarithm (double x, double minmax[2], double param); double (*matrixGet_scaleVal) (double x, double minmax[2], double param); double matrixGet_zeroCenteredLog (double x, double minmax[2], double param); void matrixInit ();
Some very basic linear algebra are redefined here. It also gives access to coordinates conversion, essentially between cartesian and spherical.
void 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. |
void 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. |
void 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. |
gboolean 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 ; |
|
a full 3x3 matrix to be transformed. |
Returns : |
FALSE if the given matrix is planar. |
void 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. |
typedef enum { linear, logarithm, zeroCentredLog, n_scaleflag } matrix_scaleflag;
Flag used to specify the transformation for scalarFieldDraw_map()
routine.
a linear convertion from [min,max] to [0,1] ; | |
a logarithmic 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 logarithmic 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
double matrixGet_invLinear (double x, double minmax[2], double param);
Reverse function for matrixGet_linear()
.
|
the initial value ; |
|
the boundaries for the x argument ;
|
|
a parameter (unused). |
Returns : |
a value into [0;1]. |
Since 3.5
double matrixGet_invLogarithm (double x, double minmax[2], double param);
Reverse function for matrixGet_logarithm()
.
|
the initial value ; |
|
the boundaries for the x argument ;
|
|
the second minimum value, used as reference for the log scale. |
Returns : |
a value into [0;1]. |
Since 3.5
double matrixGet_invZeroCenteredLog (double x, double minmax[2], double param);
Reverse function for matrixGet_zeroCenteredLog()
.
|
the initial value ; |
|
the boundaries for the x argument ;
|
|
the result of MAX(minmax [1], -minax [0]).
|
Returns : |
a value into [0;1]. |
Since 3.5
double matrixGet_linear (double x, double minmax[2], double param);
Transform x
into [0;1] with a linear scale.
|
the initial value ; |
|
the boundaries for the x argument ;
|
|
a parameter (unused). |
Returns : |
a value into [0;1]. |
Since 3.5
double matrixGet_logarithm (double x, double minmax[2], double param);
Transform x
into [0;1] with a log scale.
|
the initial value ; |
|
the boundaries for the x argument ;
|
|
the second minimum value, used as reference for the log scale. |
Returns : |
a value into [0;1]. |
Since 3.5
double (*matrixGet_scaleVal) (double x, double minmax[2], double param);
Transform x
into [0;1] using the given minmax
values.
|
the initial value ; |
|
the boundaries for the x argument ;
|
|
a parameter. |
Returns : |
a value into [0;1]. |
Since 3.4
double matrixGet_zeroCenteredLog (double x, double minmax[2], double param);
Transform x
into [0;1] with a log scale with zero centred values.
|
the initial value ; |
|
the boundaries for the x argument ;
|
|
the result of MAX(minmax [1], -minax [0]).
|
Returns : |
a value into [0;1]. |
Since 3.5