BRL-CAD
pointgen.h
Go to the documentation of this file.
1 /* P O I N T G E N . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2004-2024 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 
21 /*----------------------------------------------------------------------*/
22 /* @file pointgen.h */
23 /** @addtogroup bg_pointgen */
24 /** @{ */
25 
26 /**
27  * @brief Routines for the generation of pseudo-random and quasi-random
28  * points.
29  */
30 
31 #ifndef BG_POINTGEN_H
32 #define BG_POINTGEN_H
33 
34 #include "common.h"
35 #include "vmath.h"
36 #include "bn/numgen.h"
37 #include "bg/defines.h"
38 
39 __BEGIN_DECLS
40 
41 /**
42  * @brief
43  * Generate points on a sphere per Marsaglia (1972).
44  *
45  * The return code is the number of points generated.
46  *
47  * The user is responsible for selecting the numerical generator used to
48  * supply pseudo or quasi-random numbers to bg_sph_sample - different
49  * types of inputs may be needed depending on the application.
50  */
51 BG_EXPORT extern size_t bg_sph_sample(point_t *pnts, size_t cnt, const point_t center, const fastf_t radius, bn_numgen n);
52 
53 __END_DECLS
54 
55 #endif /* BG_POINTGEN_H */
56 /** @} */
57 /*
58  * Local Variables:
59  * mode: C
60  * tab-width: 8
61  * indent-tabs-mode: t
62  * c-file-style: "stroustrup"
63  * End:
64  * ex: shiftwidth=4 tabstop=8
65  */
Header file for the BRL-CAD common definitions.
size_t bg_sph_sample(point_t *pnts, size_t cnt, const point_t center, const fastf_t radius, bn_numgen n)
Routines for the generation of pseudo-random and quasi-random points.
struct bn_num_s * bn_numgen
Definition: numgen.h:51
void float float int * n
Definition: tig.h:74
double fastf_t
fastest 64-bit (or larger) floating point type
Definition: vmath.h:334
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition: vmath.h:355
fundamental vector, matrix, quaternion math macros