globals.c

Go to the documentation of this file.
00001 /*                       G L O B A L S . C
00002  * BRL-CAD
00003  *
00004  * Copyright (c) 2008-2012 United States Government as represented by
00005  * the U.S. Army Research Laboratory.
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public License
00009  * version 2.1 as published by the Free Software Foundation.
00010  *
00011  * This library is distributed in the hope that it will be useful, but
00012  * WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this file; see the file named COPYING for more
00018  * information.
00019  */
00020 /** @file libbn/globals.c
00021  *
00022  * Global variables in LIBBN.
00023  *
00024  * New global variables are discouraged and refactoring in ways that
00025  * eliminates existing global variables without reducing functionality
00026  * is always encouraged.
00027  *
00028  */
00029 
00030 #include "common.h"
00031 
00032 #include <math.h>
00033 
00034 #include "vmath.h"
00035 #include "bn.h"
00036 
00037 
00038 /* see rand.c for random constant globals */
00039 extern const float bn_rand_table[];
00040 extern double bn_sin_scale;
00041 extern const float bn_sin_table[];
00042 extern int bn_randhalftabsize;
00043 extern float bn_rand_halftab[];
00044 extern float bn_rand_poison_[];
00045 
00046 /* see vectfont.c for vector font constant globals */
00047 extern int *tp_cindex[];
00048 extern int tp_ctable[];
00049 
00050 
00051 /**
00052  * pi
00053  */
00054 const fastf_t bn_pi = M_PI;
00055 /**
00056  * pi*2
00057  */
00058 const fastf_t bn_twopi = 2.0 * M_PI;
00059 
00060 /**
00061  * pi/2
00062  */
00063 const fastf_t bn_halfpi = M_PI_2;
00064 /**
00065  * pi/4
00066  */
00067 const fastf_t bn_quarterpi = M_PI_4;
00068 
00069 /**
00070  * 1/pi
00071  */
00072 const fastf_t bn_invpi = M_1_PI;
00073 /**
00074  * 1/(pi*2)
00075  */
00076 const fastf_t bn_inv2pi = 1.0 / (2.0 * M_PI);
00077 /**
00078  * 1/(pi*4)
00079  */
00080 const fastf_t bn_inv4pi = 1.0 / (4.0 * M_PI);
00081 
00082 /**
00083  * 1.0/255.0
00084  */
00085 const fastf_t bn_inv255 = 1.0 / 255.0;
00086 
00087 /**
00088  * (pi*2)/360
00089  */
00090 const fastf_t bn_degtorad = DEG2RAD;
00091 /**
00092  * 360/(pi*2)
00093  */
00094 const fastf_t bn_radtodeg = RAD2DEG;
00095 
00096 
00097 /*
00098  * Local Variables:
00099  * tab-width: 8
00100  * mode: C
00101  * indent-tabs-mode: t
00102  * c-file-style: "stroustrup"
00103  * End:
00104  * ex: shiftwidth=4 tabstop=8
00105  */
Generated on Tue Dec 11 13:14:27 2012 for LIBBN by  doxygen 1.6.3