37 #ifndef EGS_CIRCLE_PERPENDICULAR_ 
   38 #define EGS_CIRCLE_PERPENDICULAR_ 
   46     #ifdef BUILD_CIRCLE_PERPENDICULAR_DLL 
   47         #define EGS_CIRCLE_PERPENDICULAR_EXPORT __declspec(dllexport) 
   49         #define EGS_CIRCLE_PERPENDICULAR_EXPORT __declspec(dllimport) 
   51     #define EGS_CIRCLE_PERPENDICULAR_LOCAL 
   55     #ifdef HAVE_VISIBILITY 
   56         #define EGS_CIRCLE_PERPENDICULAR_EXPORT __attribute__ ((visibility ("default")))
 
   57         #define EGS_CIRCLE_PERPENDICULAR_LOCAL  __attribute__ ((visibility ("hidden")))
 
   59         #define EGS_CIRCLE_PERPENDICULAR_EXPORT 
   60         #define EGS_CIRCLE_PERPENDICULAR_LOCAL 
  123         A = M_PI*dr*(dr + 2*ro);
 
  127         EGS_Float r = ro + dr*sqrt(rndm->
getUniform());
 
  128         EGS_Float cphi, sphi;
 
  130         return EGS_Vector(xo + r*cphi, yo + r*sphi, 0);
 
  144         EGS_Float d2i = 1/u.length2(), di = sqrt(d2i);
 
  149         EGS_Float angleBetween = std::acos(u * perpToCircle / (perpToCircle.length() * u.length()));
 
  153         if (fabs(fabs(u.
z) - perpToCircle.
z) < 
epsilon) {
 
  154             rotateAbout = perpToCircle;
 
  157             rotateAbout = u.times(perpToCircle);
 
  170         d2i = 1/u.length2(), di = sqrt(d2i);
 
  172         wt = A*u.length()*d2i;
 
  180     EGS_Float xo, yo, ro, dr;
 
virtual EGS_Vector getPoint(EGS_RandomGenerator *rndm)
Sample and return a random 3D vector.
 
A circle shape perpendicular to source particles.
 
EGS_CirclePerpendicularShape(EGS_Float Xo, EGS_Float Yo, EGS_Float R, EGS_Float R_i=0, const string &Name="", EGS_ObjectFactory *f=0)
Conctruct a circle with midpoint given by Xo and Yo, radius R and innder radius R_i.
 
Base random number generator class. All random number generators should be derived from this class.
 
void getAzimuth(EGS_Float &cphi, EGS_Float &sphi)
Sets cphi and sphi to the cosine and sine of a random angle uniformely distributed between 0 and .
 
EGS_Float getUniform()
Returns a random number uniformly distributed between zero (inclusive) and 1 (exclusive).
 
A class for vector rotations.
 
static EGS_RotationMatrix rotV(EGS_Float phi, const EGS_Vector &v)
Returns a rotation by the angle phi around the axis defined by the vector v.
 
void getPointSourceDirection(const EGS_Vector &Xo, EGS_RandomGenerator *rndm, EGS_Vector &u, EGS_Float &wt)
Get a random direction given a source position Xo.
 
A class representing 3D vectors.
 
Attempts to fix broken math header files.
 
EGS_RandomGenerator class header file.
 
EGS_BaseShape and shape classes header file.
 
const EGS_Float epsilon
The epsilon constant for floating point comparisons.