planners/sequential/gdefs.h

Go to the documentation of this file.
00001 #ifndef __GDEFS_H_
00002 #define __GDEFS_H_
00003 
00004 /*--- Notational aids [Byte magazine, May 1986] ---*/
00005 
00006 #define BEGIN {
00007 #define END   }
00008 //#define byte  unsigned char 
00009 #define TRUE      1
00010 #define FALSE     0             
00011 //#define bool     int          
00012 #define DIV       /
00013 #define MOD       %
00014 #define OR        ||
00015 #define AND       &&
00016 #define NOT       !
00017 #define EQ        ==
00018 #define NEQ       !=
00019 #define NL printf("\n");    
00020 #define STAR printf("*\n");    
00021 #define STARR printf("**\n");
00022 
00023 
00024 /*---  Useful macros ---*/
00025 
00026 #define SQR(x) ((x)*(x))
00027 #ifndef MIN
00028 #define MIN(x,y) ((x) <= (y) ? (x) : (y) )    
00029 #endif
00030 #ifndef MAX
00031 #define MAX(x,y) ((x) >= (y) ? (x) : (y) )    
00032 #endif
00033 #define ABS(x)  ((x)<0 ? -(x) :(x) )
00034 #define RADIAN(ang) ( ((ang)/180.0)*PI )
00035 #define DEGREE(rad) ( ((rad)*180.0/PI )
00036 #define ROUND(f) ( (int)(f+0.5) )
00037 #define BOUND_T(x, lnkno1) \
00038 ( x<0 ? 0 : (x >= dimt[lnkno1] ? dimt[lnkno1]-1 : x) )
00039 #define BOUND_Q(x, lnkno1) \
00040 ( x<0 ? 0 : (x >= dimq[lnkno1] ? dimq[lnkno1]-1 : x) )
00041 #define BOUND_W(x) \
00042 ( x<0 ? 0 : (x >= DIMX ? DIMX-1 : x) )
00043 
00044 /*---  Useful type definitions ---*/
00045 
00046 typedef char strngT[80];
00047 
00048 /* Micros for vector operation          */
00049 #define PASSIGN(p1, p2) ( (p2).x = (p1).x; (p2).y = (p1).y )
00050 #define PADD(p1,p2,psum) ((psum).x=(p1).x+(p2).x; (psum).y=(p1).x+(p2).y;)
00051 
00052 #endif

Generated on Sat Apr 1 21:30:46 2006 for Motion Planning Kernel by  doxygen 1.4.6-NO