macroses.h File Reference

Usefull macroses. More...

#include "memory_macroses.h"
#include "debug_macroses.h"

Include dependency graph for macroses.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define CALC_VECTOR(N_S, N_E, V)   (V)[0] = (N_E).array[0] - (N_S).array[0];(V)[2] = (N_E).array[2] - (N_S).array[2];(V)[1] = (N_E).array[1] - (N_S).array[1];
 calculate vector from begin and end points, N_S -- start point, N_E -- end point, V -- output vector
#define CALC_TRIANGLE_AREA(V1, V2)   (0.5 * fabs((V1)[1] * (V2)[2] - (V1)[2] * (V2)[1] + (V1)[2] * (V2)[0] - (V1)[0] * (V2)[2] + (V1)[0] * (V2)[1] - (V1)[1] * (V2)[0]))
 calculate triange area, V1 -- first vector, V2 -- second vector
#define CALC_VECT_MULT(V1, V2, R)
 calculate vect mult
#define CALC_VECT_NORM(V)   sqrt((V)[0] * (V)[0] + (V)[1] * (V)[1] + (V)[2] * (V)[2])
 calculate vect norm
#define CALC_GEOM_AVERAGE(D1, D2)   ((D1) * (D2) / ((D1) + (D2)))
 calculate geometric average
#define CALC_IJK_FROM_INDEX(IND, NX, NY, NZ, I, J, K)
 calculate cell ijk index from linear index IND -- linear index, NX, NY, NZ -- dimens, I, J, K -- output indexes
#define CALC_INDEX_FROM_IJK(IND, NX, NY, NZ, I, J, K)   IND = I + J * NX + K * NX * NY \
 calculate cell ijk index from linear index IND -- linear index, NX, NY, NZ -- dimens, I, J, K -- output indexes
#define MIN(a, b)   ((a)<(b)?(a):(b))
 Minimum of a and b.
#define MAX(a, b)   ((a)<(b)?(b):(a))
 Maximum of a and b.


Detailed Description

Usefull macroses.

Author:
Borschuk Oleg
Date:
26.09.2005 This source code is released under the terms of the BSD License. See LICENSE for more details.
Todo:
Obsolete

Desribe


Define Documentation

#define CALC_GEOM_AVERAGE ( D1,
D2   )     ((D1) * (D2) / ((D1) + (D2)))

calculate geometric average

#define CALC_IJK_FROM_INDEX ( IND,
NX,
NY,
NZ,
I,
J,
 ) 

Value:

(K) = (int)((IND) / ((NX) * (NY)));                                   \
  (IND) -= (K) * (NX) * (NY);                                           \
  (J) = (int)((IND) / (NX));                                            \
  (I) = (IND) - (J) * (NX);
calculate cell ijk index from linear index IND -- linear index, NX, NY, NZ -- dimens, I, J, K -- output indexes

#define CALC_INDEX_FROM_IJK ( IND,
NX,
NY,
NZ,
I,
J,
 )     IND = I + J * NX + K * NX * NY \

calculate cell ijk index from linear index IND -- linear index, NX, NY, NZ -- dimens, I, J, K -- output indexes

#define CALC_TRIANGLE_AREA ( V1,
V2   )     (0.5 * fabs((V1)[1] * (V2)[2] - (V1)[2] * (V2)[1] + (V1)[2] * (V2)[0] - (V1)[0] * (V2)[2] + (V1)[0] * (V2)[1] - (V1)[1] * (V2)[0]))

calculate triange area, V1 -- first vector, V2 -- second vector

#define CALC_VECT_MULT ( V1,
V2,
 ) 

Value:

R[0] = (V1)[1] * (V2)[2] - (V1)[2] * (V2)[1];   \
        R[1] = (V1)[2] * (V2)[0] - (V1)[0] * (V2)[2];   \
        R[2] = (V1)[0] * (V2)[1] - (V1)[1] * (V2)[0];
calculate vect mult

#define CALC_VECT_NORM (  )     sqrt((V)[0] * (V)[0] + (V)[1] * (V)[1] + (V)[2] * (V)[2])

calculate vect norm

#define CALC_VECTOR ( N_S,
N_E,
 )     (V)[0] = (N_E).array[0] - (N_S).array[0];(V)[2] = (N_E).array[2] - (N_S).array[2];(V)[1] = (N_E).array[1] - (N_S).array[1];

calculate vector from begin and end points, N_S -- start point, N_E -- end point, V -- output vector

#define MAX ( a,
 )     ((a)<(b)?(b):(a))

Maximum of a and b.

#define MIN ( a,
 )     ((a)<(b)?(a):(b))

Minimum of a and b.


Generated on Fri Nov 13 12:07:13 2009 for TheBSEagleProject by  doxygen 1.5.8