Main Page   Compound List   File List   Compound Members   File Members  

EightNbr.h

Go to the documentation of this file.
00001 
00026 #ifndef EightNbr_H
00027 #define EightNbr_H
00028 
00029 #include <stdlib.h>
00030 
00031 /*
00032  *********************************************************
00033  * DEFINES, ENUMS
00034  *********************************************************
00035  */
00036 
00040 #define EIGHTNBR_NUM_NBR_CELLS                                  (8)
00041 
00042 /* enumerations used to represent nbr azimuths available with current NbrScheme */
00043 enum  {
00044     EIGHTNBR_NORTH          = 0,
00045     EIGHTNBR_NORTHEAST      = 1,
00046     EIGHTNBR_EAST           = 2,
00047     EIGHTNBR_SOUTHEAST      = 3,
00048     EIGHTNBR_SOUTH          = 4,
00049     EIGHTNBR_SOUTHWEST      = 5,
00050     EIGHTNBR_WEST           = 6,
00051     EIGHTNBR_NORTHWEST      = 7
00052     };
00053  
00054 /*
00055  *********************************************************
00056  * STRUCTS, TYPEDEFS
00057  *********************************************************
00058  */
00059 
00061 static const int    egtnbr_col  [EIGHTNBR_NUM_NBR_CELLS]    = {  0,    1,    1,     1,     0,    -1,    -1,    -1};
00062 
00064 static const int    egtnbr_row  [EIGHTNBR_NUM_NBR_CELLS]    = { -1,   -1,    0,     1,     1,     1,     0,    -1};
00065 
00067 static const double egtnbr_az   [EIGHTNBR_NUM_NBR_CELLS]    = {0.0, 45.0, 90.0, 135.0, 180.0, 225.0, 270.0, 315.0};
00068 
00070 static const double egtnbr_dist [EIGHTNBR_NUM_NBR_CELLS]    = {1.0, 1.4142, 1.0, 1.4142, 1.0, 1.4142, 1.0, 1.4142};
00071  
00072 /*
00073  *********************************************************
00074  * MACROS
00075  *********************************************************
00076  */
00077 
00081 #define EIGHTNBR_ROW_INDEX_AT_AZIMUTH(i, azimuth)               ((i) + egtnbr_row[azimuth])
00082  
00086 #define EIGHTNBR_COL_INDEX_AT_AZIMUTH(j, azimuth)               ((j) + egtnbr_col[azimuth])
00087 
00091 #define EIGHTNBR_AZIMUTH_AS_DBL(azimuth)                        (egtnbr_az[(azimuth)])
00092 
00096 #define EIGHTNBR_CART_DIST_AT_AZIMUTH(azimuth, cellsz)          (((egtnbr_dist[(azimuth)]) * (cellsz)))
00097  
00098 /*
00099  *********************************************************
00100  * PUBLIC FUNCTIONS
00101  *********************************************************
00102  */
00103  
00104 #endif EightNbr_H       /* end of EightNbr.h */

Generated at Fri Jun 22 00:46:50 2001 for HFire by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000