Jpp  17.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JGeometry2DTestkit.hh
Go to the documentation of this file.
1 #ifndef __JGEOMETRY2DTESTKIT__
2 #define __JGEOMETRY2DTESTKIT__
3 
4 #include "TRandom3.h"
5 
7 #include "JMath/JRandom.hh"
8 #include "JMath/JConstants.hh"
9 
10 /**
11  * \author mdejong
12  */
13 
14 namespace JGEOMETRY2D {}
15 namespace JPP { using namespace JGEOMETRY2D; }
16 
17 namespace JGEOMETRY2D {
18 
19  using JMATH::PI;
20  using JMATH::getRandom;
21 
22 
23  /**
24  * Randomize position.
25  *
26  * \param p pointer to valid object
27  */
28  inline void randomize(JPosition2D* p)
29  {
30  new (p) JPosition2D(getRandom<double>(-1.0, +1.0),
31  getRandom<double>(-1.0, +1.0));
32  };
33 }
34 
35 #endif
Definition of random value generator.
Mathematical constants.
static const double PI
Mathematical constants.
Data structure for position in two dimensions.
Definition: JPosition2D.hh:31
T getRandom()
Get random value.
Definition: JRandom.hh:113
void randomize(Vec *p)
Randomize 3D vector.