26 int main(
int argc,
char**argv)
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);
110 DEBUG(
"R " << endl << R);
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);