62#define BN_CK_UNIF(_p) BU_CKMAG(_p, BN_UNIF_MAGIC, "bn_unif")
63#define BN_CK_GAUSS(_p) BU_CKMAG(_p, BN_GAUSS_MAGIC, "bn_gauss")
241#define BN_UNIF_LONG(_p) \
242 (((_p)->msr_long_ptr) ? \
243 (_p)->msr_longs[--(_p)->msr_long_ptr] : \
244 bn_unif_long_fill(_p))
245#define BN_UNIF_DOUBLE(_p) \
246 (((_p)->msr_double_ptr) ? \
247 (_p)->msr_doubles[--(_p)->msr_double_ptr] : \
248 bn_unif_double_fill(_p))
250#define BN_UNIF_CIRCLE(_p, _x, _y, _r) { \
252 (_x) = 2.0*BN_UNIF_DOUBLE((_p)); \
253 (_y) = 2.0*BN_UNIF_DOUBLE((_p)); \
254 (_r) = (_x)*(_x)+(_y)*(_y); \
255 } while ((_r) >= 1.0); }
257#define BN_UNIF_SPHERE(_p, _x, _y, _z, _r) { \
259 (_x) = 2.0*BN_UNIF_DOUBLE(_p); \
260 (_y) = 2.0*BN_UNIF_DOUBLE(_p); \
261 (_z) = 2.0*BN_UNIF_DOUBLE(_p); \
262 (_r) = (_x)*(_x)+(_y)*(_y)+(_z)*(_z);\
263 } while ((_r) >= 1.0) }
265#define BN_GAUSS_DOUBLE(_p) \
266 (((_p)->msr_gauss_ptr) ? \
267 (_p)->msr_gausses[--(_p)->msr_gauss_ptr] : \
Header file for the BRL-CAD common definitions.
void bn_unif_free(struct bn_unif *p)
struct bn_unif * bn_unif_init(long setseed, int method)
long bn_unif_long_fill(struct bn_unif *p)
double bn_gauss_fill(struct bn_gauss *p)
double bn_unif_double_fill(struct bn_unif *p)
struct bn_gauss * bn_gauss_init(long setseed, int method)
void bn_gauss_free(struct bn_gauss *p)
Global registry of recognized magic numbers.
double * msr_gauss_doubles