Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

clip.h

Go to the documentation of this file.
00001 #ifndef CLIP_H
00002 #define CLIP_H
00003 
00004 // Math macros
00005 
00006 #define CLIP(x, y, z) ((x) < (y) ? (y) : ((x) > (z) ? (z) : (x)))
00007 #define RECLIP(x, y, z) ((x) = ((x) < (y) ? (y) : ((x) > (z) ? (z) : (x))))
00008 #define CLAMP(x, y, z) ((x) = ((x) < (y) ? (y) : ((x) > (z) ? (z) : (x))))
00009 #define MAX(x, y) ((x) > (y) ? (x) : (y))
00010 #define MIN(x, y) ((x) < (y) ? (x) : (y))
00011 #define EQUIV(x, y) (fabs((x) - (y)) < 0.001)
00012 #define DISTANCE(x1, y1, x2, y2) \
00013 (sqrt(((x2) - (x1)) * ((x2) - (x1)) + ((y2) - (y1)) * ((y2) - (y1))))
00014 
00015 
00016 #endif

Generated on Sun Jan 8 13:26:34 2006 for Guicast-svn by  doxygen 1.4.4