source: trunk/MagicSoft/Simulation/Detector/include-GENERAL/jcmacros.h@ 3160

Last change on this file since 3160 was 293, checked in by harald, 25 years ago
This this directory you can find some header files that are needed by reflector and by camera. On example is the declaration-(header)-file of the runlib. This is the starting point for further development. This work was done by Jose Carlos Gonzales. Now this is under CVS control.
File size: 2.2 KB
Line 
1/**********************************************************************
2 **********************************************************************
3 * jcmacros
4 *
5 * Created: Mon Jan 12 10:14:05 1998
6 * Author.: Jose Carlos Gonzales
7 * Notes..:
8 *
9 **********************************************************************
10 **********************************************************************/
11
12// @T \newpage
13
14// @section Source code of {\tt jcmacros.h}
15
16// @code
17
18/* Begin */
19
20#ifndef __JC_MACROS__
21#define __JC_MACROS__
22
23#define TRUE 1
24#define FALSE 0
25#define YES 1.
26#define NO 0.
27
28#define SQR(x) ((x)*(x))
29#define CUB(x) ((x)*(x)*(x))
30#define ABS(x) (((x)<0)? -(x) : (x))
31#define SGN(x) (((x)>0.)? 1. : -1.)
32#define MAX(a,b) (((a)>(b))?(a):(b))
33#define MIN(a,b) (((a)<(b))?(a):(b))
34#define DEG2RAD (M_PI/180.)
35#define NORM(x) (sqrt(SQR(x[0])+SQR(x[1])+SQR(x[2]))) /* Norm(vector) */
36#define PROD(x,y) ((x[0]*y[0])+(x[1]*y[1])+(x[2]*y[2])) /* Direct.Prod. */
37
38#define DEG2RAD (M_PI/180.) /* Degrees to Radians conversion factor */
39#define DEG360 (2.*M_PI) /* 2 Pi */
40#define DEG180 (M_PI) /* Pi */
41#define DEG120 (2.*M_PI/3.) /* 2 Pi / 3 */
42#define DEG90 (M_PI/2.) /* Pi / 2 */
43#define DEG60 (M_PI/3.) /* Pi / 3 */
44#define DEG30 (M_PI/6.) /* Pi / 6 */
45#define RAD(x) ((x)*0.0174532925199433)
46#define DEG(x) ((x)*57.2957795130823)
47
48
49#define RANDOM ((float)drand48()) /* Uniform random number */
50
51 /* Define Null pointer (in fact, */
52#define NIL (void *)0 /* there is a NULL=(void*)0 defined) */
53
54#endif // __JC_MACROS__
55
56// @endcode
57
58/* End */
Note: See TracBrowser for help on using the repository browser.