Example program to test rotations in 3D.  
More...
Go to the source code of this file.
 | 
| int  | main (int argc, char **argv) | 
|   | 
Example program to test rotations in 3D. 
- Author
 - mdejong 
 
Definition in file JGeometry3D.cc.
 
      
        
          | int main  | 
          ( | 
          int  | 
          argc,  | 
        
        
           | 
           | 
          char **  | 
          argv  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 26 of file JGeometry3D.cc.
   37     JParser<> zap(
"Example program to test rotations in 3D.");
 
   46   catch(
const exception &error) {
 
   47     FATAL(error.what() << endl);
 
   50   gRandom->SetSeed(seed);
 
   55   JQuantile Q(
"Distance");
 
   57   const JVector3D 
v[] = { JVector3D(1,0,0),     
 
   61   for (
int i = 0; i != numberOfEvents; ++i) {
 
   63     STATUS(
"event: " << setw(10) << i << 
'\r'); 
DEBUG(endl);
 
   65     const double theta = gRandom->Uniform(0.0, 
PI);
 
   66     const double phi   = gRandom->Uniform(0.0, 2*
PI);
 
   68     const JAngle3D    dir(theta, phi);          
 
   69     const JRotation3D 
R(dir);
 
   77     const JQuaternion3X Rx(0.0);                
 
   78     const JQuaternion3Y Ry(theta);              
 
   79     const JQuaternion3Z Rz(phi);                
 
   82     JQuaternion3D Rs(Rx, Ry, Rz);
 
   88     for (
int j = 0; 
j != 
sizeof(
v)/
sizeof(
v[0]); ++
j) {
 
  100       Q.put((B - 
A).getLength());
 
  102       if ((B - 
A).getLengthSquared() > precision*precision) {
 
  104         DEBUG(
"theta " << theta << endl);
 
  105         DEBUG(
"phi   " << phi   << endl);
 
  112         ERROR(
"A " << 
FIXED(7,3) << 
A.getX() << 
' ' << 
A.getY() << 
' ' << 
A.getZ() << endl);
 
  113         ERROR(
"B " << 
FIXED(7,3) << B.getX() << 
' ' << B.getY() << 
' ' << B.getZ() << endl);
 
Utility class to parse command line options. 
 
Auxiliary data structure for floating point format specification. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
static const double PI
Mathematical constants. 
 
then usage $script[distance] fi case set_variable R
 
source $JPP_DIR setenv csh $JPP_DIR eval JShellParser o a A
 
#define DEBUG(A)
Message macros.